All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, Christoph Lameter <cl@linux.com>,
	Kevin Hilman <khilman@linaro.org>,
	Mike Galbraith <bitbucket@online.de>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 3/3 V7] workqueue: Allow modifying low level unbound workqueue cpumask
Date: Wed, 22 Apr 2015 15:39:35 -0400	[thread overview]
Message-ID: <20150422193935.GG10738@htj.duckdns.org> (raw)
In-Reply-To: <1428405998-3102-3-git-send-email-laijs@cn.fujitsu.com>

Hello,

Generally looks good to me.  Some minor things below.

On Tue, Apr 07, 2015 at 07:26:37PM +0800, Lai Jiangshan wrote:
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index cbccf5d..557612e 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -299,7 +299,7 @@ static DEFINE_SPINLOCK(wq_mayday_lock);	/* protects wq->maydays list */
>  static LIST_HEAD(workqueues);		/* PR: list of all workqueues */
>  static bool workqueue_freezing;		/* PL: have wqs started freezing? */
>  
> -static cpumask_var_t wq_unbound_global_cpumask;
> +static cpumask_var_t wq_unbound_global_cpumask; /* PL: low level cpumask for all unbound wqs */

Are we set on this variable name?  What would we lose by naming it
wq_unbound_cpumask or wq_cpu_possible_mask?

> @@ -3493,6 +3493,7 @@ static struct pool_workqueue *numa_pwq_tbl_install(struct workqueue_struct *wq,
>  struct apply_wqattrs_ctx {
>  	struct workqueue_struct	*wq;	/* target to be applied */
>  	struct workqueue_attrs	*attrs;	/* configured attrs */
> +	struct list_head	list;	/* queued for batching commit */
                                                      batch commit
>  	struct pool_workqueue	*dfl_pwq;
>  	struct pool_workqueue	*pwq_tbl[];
>  };
> @@ -3517,7 +3518,8 @@ static void apply_wqattrs_cleanup(struct apply_wqattrs_ctx *ctx)
>  /* Allocates the attrs and pwqs for later installment */
>  static struct apply_wqattrs_ctx *
>  apply_wqattrs_prepare(struct workqueue_struct *wq,
> -		      const struct workqueue_attrs *attrs)
> +		      const struct workqueue_attrs *attrs,
> +		      cpumask_var_t unbound_cpumask)

Why do we need this tho?  The global mask is protected by pool mutex,
right?  The update function can set it to the new value and just call
update and revert on failure.

> @@ -3710,6 +3721,14 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu,
>  	 * wq's, the default pwq should be used.
>  	 */
>  	if (wq_calc_node_cpumask(wq->unbound_attrs, node, cpu_off, cpumask)) {
> +		/*
> +		 * wq->unbound_attrs is the user configured attrs whose
> +		 * cpumask is not masked with wq_unbound_global_cpumask,
> +		 * so we make complete it.
> +		 */
> +		cpumask_and(cpumask, cpumask, wq_unbound_global_cpumask);
> +		if (cpumask_empty(cpumask))
> +			goto use_dfl_pwq;

Wouldn't it be better to apply the global cpumask before calling
wq_calc_node_cpumask()?  Or just move it inside wq_calc_node_cpumask?

Thanks.

-- 
tejun

  reply	other threads:[~2015-04-22 19:39 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12  5:00 [PATCH 0/4] workqueue: Introduce low-level unbound wq sysfs cpumask v4 Lai Jiangshan
2015-03-12  5:00 ` [PATCH 1/4] workqueue: Reorder sysfs code Lai Jiangshan
2015-03-12  5:00 ` [PATCH 2/4] workqueue: split apply_workqueue_attrs() into 3 stages Lai Jiangshan
2015-03-12  5:00 ` [PATCH 3/4] workqueue: Create low-level unbound workqueues cpumask Lai Jiangshan
2015-03-12 17:33   ` Christoph Lameter
2015-03-13 23:49   ` Kevin Hilman
2015-03-14  0:52     ` Kevin Hilman
2015-03-14  7:52     ` Lai Jiangshan
2015-03-16 17:12       ` Kevin Hilman
2015-03-16 17:25         ` Frederic Weisbecker
2015-03-16 19:38           ` Kevin Hilman
2015-03-12  5:00 ` [PATCH 4/4] workqueue: Allow modifying low level unbound workqueue cpumask Lai Jiangshan
2015-03-12 17:42   ` Christoph Lameter
2015-03-13  1:38     ` Lai Jiangshan
2015-03-13  7:49   ` Lai Jiangshan
2015-03-12 17:49 ` [PATCH 0/4] workqueue: Introduce low-level unbound wq sysfs cpumask v4 Frederic Weisbecker
2015-03-13  6:02 ` Mike Galbraith
2015-03-18  4:40 ` [PATCH 0/4 V5] workqueue: Introduce low-level unbound wq sysfs cpumask v5 Lai Jiangshan
2015-03-18  4:40   ` [PATCH 1/4 V5] workqueue: Reorder sysfs code Lai Jiangshan
2015-03-24 15:41     ` Tejun Heo
2015-03-18  4:40   ` [PATCH 2/4 V5] workqueue: split apply_workqueue_attrs() into 3 stages Lai Jiangshan
2015-03-24 15:55     ` Tejun Heo
2015-03-18  4:40   ` [PATCH 3/4 V5] workqueue: Create low-level unbound workqueues cpumask Lai Jiangshan
2015-03-18  4:40   ` [PATCH 4/4 V5] workqueue: Allow modifying low level unbound workqueue cpumask Lai Jiangshan
2015-03-24 17:31     ` Tejun Heo
2015-03-31  7:46       ` Lai Jiangshan
2015-04-01  8:33         ` Lai Jiangshan
2015-04-01 15:52           ` Tejun Heo
2015-03-19  8:54   ` [PATCH 0/4 V5] workqueue: Introduce low-level unbound wq sysfs cpumask v5 Mike Galbraith
2015-04-02 11:14   ` [PATCH 0/4 V6] " Lai Jiangshan
2015-04-02 11:14     ` [PATCH 1/4 V6] workqueue: Reorder sysfs code Lai Jiangshan
2015-04-06 15:22       ` Tejun Heo
2015-04-02 11:14     ` [PATCH 2/4 V6] workqueue: split apply_workqueue_attrs() into 3 stages Lai Jiangshan
2015-04-06 15:39       ` Tejun Heo
2015-04-02 11:14     ` [PATCH 3/4 V6] workqueue: Create low-level unbound workqueues cpumask Lai Jiangshan
2015-04-02 11:14     ` [PATCH 4/4 V6] workqueue: Allow modifying low level unbound workqueue cpumask Lai Jiangshan
2015-04-06 15:53       ` Tejun Heo
2015-04-07  1:25         ` Lai Jiangshan
2015-04-07  1:58           ` Tejun Heo
2015-04-07  2:33             ` Lai Jiangshan
2015-04-07 11:26     ` [PATCH 1/3 V7] workqueue: split apply_workqueue_attrs() into 3 stages Lai Jiangshan
2015-04-07 11:26       ` [PATCH 2/3 V7] workqueue: Create low-level unbound workqueues cpumask Lai Jiangshan
2015-04-07 11:26       ` [PATCH 3/3 V7] workqueue: Allow modifying low level unbound workqueue cpumask Lai Jiangshan
2015-04-22 19:39         ` Tejun Heo [this message]
2015-04-22 23:02           ` Frederic Weisbecker
2015-04-23  6:29             ` Mike Galbraith
2015-04-17 14:57       ` [PATCH 1/3 V7] workqueue: split apply_workqueue_attrs() into 3 stages Tejun Heo
2015-04-20  3:21         ` Lai Jiangshan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150422193935.GG10738@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=bitbucket@online.de \
    --cc=cl@linux.com \
    --cc=fweisbec@gmail.com \
    --cc=khilman@linaro.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.