public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <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>,
	Tejun Heo <tj@kernel.org>, Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH 1/5] workqueue: Allow changing attributions of ordered workqueues
Date: Wed, 21 May 2014 15:29:08 +0800	[thread overview]
Message-ID: <537C55C4.70706@cn.fujitsu.com> (raw)
In-Reply-To: <1400257015-28222-2-git-send-email-fweisbec@gmail.com>

On 05/17/2014 12:16 AM, Frederic Weisbecker wrote:

> @@ -3708,6 +3712,13 @@ static void rcu_free_pwq(struct rcu_head *rcu)
>  			container_of(rcu, struct pool_workqueue, rcu));
>  }
>  
> +static struct pool_workqueue *oldest_pwq(struct workqueue_struct *wq)
> +{
> +	return list_last_entry(&wq->pwqs, struct pool_workqueue, pwqs_node);
> +}
> +
> +static void pwq_adjust_max_active(struct pool_workqueue *pwq);


Hi, Tejun,

Should we reorder the pwq_adjust_max_active() to avoid this declare?
(Move pwq_adjust_max_active() to the place just before rcu_free_pwq())

Thanks,
Lai

> +
>  /*
>   * Scheduled on system_wq by put_pwq() when an unbound pwq hits zero refcnt
>   * and needs to be destroyed.
> @@ -3723,14 +3734,12 @@ static void pwq_unbound_release_workfn(struct work_struct *work)
>  	if (WARN_ON_ONCE(!(wq->flags & WQ_UNBOUND)))
>  		return;
>  
> -	/*
> -	 * Unlink @pwq.  Synchronization against wq->mutex isn't strictly
> -	 * necessary on release but do it anyway.  It's easier to verify
> -	 * and consistent with the linking path.
> -	 */
>  	mutex_lock(&wq->mutex);
>  	list_del_rcu(&pwq->pwqs_node);
>  	is_last = list_empty(&wq->pwqs);
> +	/* try to activate the oldest pwq when needed */
> +	if (!is_last && (wq->flags & __WQ_ORDERED))
> +		pwq_adjust_max_active(oldest_pwq(wq));
>  	mutex_unlock(&wq->mutex);
>  
>  	mutex_lock(&wq_pool_mutex);

  parent reply	other threads:[~2014-05-21  7:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 16:16 [RFC PATCH 0/5] workqueue: Introduce low-level unbound wq sysfs cpumask v3 Frederic Weisbecker
2014-05-16 16:16 ` [PATCH 1/5] workqueue: Allow changing attributions of ordered workqueues Frederic Weisbecker
2014-05-16 20:12   ` Tejun Heo
2014-05-17 13:41     ` Frederic Weisbecker
2014-05-19 20:15       ` Tejun Heo
2014-05-20 14:32         ` Frederic Weisbecker
2014-05-20 14:35           ` Tejun Heo
2014-05-20 15:08             ` Frederic Weisbecker
2014-05-21  7:29   ` Lai Jiangshan [this message]
2014-05-21 19:18     ` Tejun Heo
2014-05-16 16:16 ` [PATCH 2/5] workqueue: Reorder sysfs code Frederic Weisbecker
2014-05-16 16:16 ` [PATCH 3/5] workqueue: Create low-level unbound workqueues cpumask Frederic Weisbecker
2014-05-16 17:52   ` Christoph Lameter
2014-05-16 18:35     ` Tejun Heo
2014-05-16 18:52       ` Christoph Lameter
2014-05-16 19:00         ` Tejun Heo
2014-05-16 19:22           ` Tejun Heo
2014-05-16 19:32           ` Christoph Lameter
2014-05-16 19:34             ` Tejun Heo
2014-05-16 19:45               ` Tejun Heo
2014-05-16 23:02                 ` Christoph Lameter
2014-05-16 23:48                   ` Tejun Heo
2014-05-17 22:45                     ` Christoph Lameter
2014-05-18  2:51                       ` Tejun Heo
2014-05-16 16:16 ` [PATCH 4/5] workqueue: Split apply attrs code from its locking Frederic Weisbecker
2014-05-16 16:16 ` [PATCH 5/5] workqueue: Allow modifying low level unbound workqueue cpumask Frederic Weisbecker
2014-05-16 20:50   ` Tejun Heo
2014-05-20 19:32     ` Frederic Weisbecker
2014-05-20 19:56       ` Tejun Heo
2014-05-20 20:08         ` Frederic Weisbecker
2014-07-11  8:41 ` [RFC PATCH 0/5] workqueue: Introduce low-level unbound wq sysfs cpumask v3 Lai Jiangshan
2014-07-11 13:11   ` Frederic Weisbecker

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=537C55C4.70706@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    --cc=bitbucket@online.de \
    --cc=cl@linux.com \
    --cc=fweisbec@gmail.com \
    --cc=khilman@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tj@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox