All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] workqueue: jumps to use_dfl_pwq if the target cpumask is equal wq's
@ 2014-04-18  0:08 Daeseok Youn
  2014-04-18 19:52 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Daeseok Youn @ 2014-04-18  0:08 UTC (permalink / raw)
  To: tj; +Cc: laijs, linux-kernel, daeseok.youn

wq_update_unbound_numa(), when it's decided that the newly updated
cpumask equals the default, looks at whether the current pwq is
already the default one and skips setting pwq to the default one.
This extra step is unnecessary and we can always jump to use_dfl_pwq
instead. Simplify the code by removing the conditional.
This doesn't make any functional difference.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
V2: update patch description and comment of code

 kernel/workqueue.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 3150b21..e122d39 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4080,17 +4080,13 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu,
 	 * Let's determine what needs to be done.  If the target cpumask is
 	 * different from wq's, we need to compare it to @pwq's and create
 	 * a new one if they don't match.  If the target cpumask equals
-	 * wq's, the default pwq should be used.  If @pwq is already the
-	 * default one, nothing to do; otherwise, install the default one.
+	 * wq's, the default pwq should be used.
 	 */
 	if (wq_calc_node_cpumask(wq->unbound_attrs, node, cpu_off, cpumask)) {
 		if (cpumask_equal(cpumask, pwq->pool->attrs->cpumask))
 			goto out_unlock;
 	} else {
-		if (pwq == wq->dfl_pwq)
-			goto out_unlock;
-		else
-			goto use_dfl_pwq;
+		goto use_dfl_pwq;
 	}
 
 	mutex_unlock(&wq->mutex);
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] workqueue: jumps to use_dfl_pwq if the target cpumask is equal wq's
  2014-04-18  0:08 [PATCH V2] workqueue: jumps to use_dfl_pwq if the target cpumask is equal wq's Daeseok Youn
@ 2014-04-18 19:52 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2014-04-18 19:52 UTC (permalink / raw)
  To: Daeseok Youn; +Cc: laijs, linux-kernel

On Fri, Apr 18, 2014 at 09:08:14AM +0900, Daeseok Youn wrote:
> wq_update_unbound_numa(), when it's decided that the newly updated
> cpumask equals the default, looks at whether the current pwq is
> already the default one and skips setting pwq to the default one.
> This extra step is unnecessary and we can always jump to use_dfl_pwq
> instead. Simplify the code by removing the conditional.
> This doesn't make any functional difference.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>

Applied to wq/for-3.16 w/ minor update to the patch title.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-18 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-18  0:08 [PATCH V2] workqueue: jumps to use_dfl_pwq if the target cpumask is equal wq's Daeseok Youn
2014-04-18 19:52 ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.