lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130319131938.73dd0f1233c8aba41742aded@canb.auug.org.au>
Date:	Tue, 19 Mar 2013 13:19:38 +1100
From:	Stephen Rothwell <sfr@...b.auug.org.au>
To:	Tejun Heo <tj@...nel.org>
Cc:	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: linux-next: manual merge of the workqueues tree with Linus' tree

Hi Tejun,

Today's linux-next merge of the workqueues tree got a conflict in
kernel/workqueue.c between commit e68035fb65de ("workqueue: convert to
idr_alloc()") from Linus' tree and commit 5bcab3355a55 ("workqueue:
separate out pool and workqueue locking into wq_mutex") from the
workqueues tree.

I fixed it up (I think - see below) and can carry the fix as necessary
(no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@...b.auug.org.au

diff --cc kernel/workqueue.c
index 55fac5b,833a152..0000000
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@@ -456,40 -462,30 +462,30 @@@ static int worker_pool_assign_id(struc
  {
  	int ret;
  
- 	mutex_lock(&worker_pool_idr_mutex);
- 	ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL);
- 	if (ret >= 0)
- 		pool->id = ret;
- 	mutex_unlock(&worker_pool_idr_mutex);
+ 	lockdep_assert_held(&wq_mutex);
+ 
+ 	do {
 -		if (!idr_pre_get(&worker_pool_idr, GFP_KERNEL))
 -			return -ENOMEM;
 -		ret = idr_get_new(&worker_pool_idr, pool, &pool->id);
++		ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL);
++		if (ret >= 0)
++			pool->id = ret;
+ 	} while (ret == -EAGAIN);
  
 -	return ret;
 +	return ret < 0 ? ret : 0;
  }
  
- /*
-  * Lookup worker_pool by id.  The idr currently is built during boot and
-  * never modified.  Don't worry about locking for now.
+ /**
+  * first_pwq - return the first pool_workqueue of the specified workqueue
+  * @wq: the target workqueue
+  *
+  * This must be called either with pwq_lock held or sched RCU read locked.
+  * If the pwq needs to be used beyond the locking in effect, the caller is
+  * responsible for guaranteeing that the pwq stays online.
   */
- static struct worker_pool *worker_pool_by_id(int pool_id)
- {
- 	return idr_find(&worker_pool_idr, pool_id);
- }
- 
- static struct worker_pool *get_std_worker_pool(int cpu, bool highpri)
+ static struct pool_workqueue *first_pwq(struct workqueue_struct *wq)
  {
- 	struct worker_pool *pools = std_worker_pools(cpu);
- 
- 	return &pools[highpri];
- }
- 
- static struct pool_workqueue *get_pwq(unsigned int cpu,
- 				      struct workqueue_struct *wq)
- {
- 	if (!(wq->flags & WQ_UNBOUND)) {
- 		if (likely(cpu < nr_cpu_ids))
- 			return per_cpu_ptr(wq->pool_wq.pcpu, cpu);
- 	} else if (likely(cpu == WORK_CPU_UNBOUND))
- 		return wq->pool_wq.single;
- 	return NULL;
+ 	assert_rcu_or_pwq_lock();
+ 	return list_first_or_null_rcu(&wq->pwqs, struct pool_workqueue,
+ 				      pwqs_node);
  }
  
  static unsigned int work_color_to_flags(int color)

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ