linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Hillf Danton <hdanton@sina.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>, Tejun Heo <tj@kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>
Subject: Re: [RFC] workqueue: fix detecting reentrance
Date: Mon, 16 Dec 2019 15:02:19 +0100	[thread overview]
Message-ID: <20191216140219.GD6444@dhcp22.suse.cz> (raw)
In-Reply-To: <20191212091548.21668-1-hdanton@sina.com>

Cc maintainers.

On Thu 12-12-19 17:15:48, Hillf Danton wrote:
> 
> If we can find a valid worker that is serving the specified work at
> the moment then the worker itself is enough to ensure reentrance and
> workqueue doesn't matter here because it is permitted for a work to
> requeue itself either on different cpu or numa node or even on another
> workqueue.

I do not follow what is the actual problem you are trying to fix here.

> Fixes: c9178087acd7 ("workqueue: perform non-reentrancy test when queueing to unbound workqueues too")
> Fixes: 18aa9effad4a ("workqueue: implement WQ_NON_REENTRANT")
> Signed-off-by: Hillf Danton <hdanton@sina.com>
> ---
> 
> --- f/kernel/workqueue.c
> +++ g/kernel/workqueue.c
> @@ -1433,7 +1433,7 @@ retry:
>  
>  		worker = find_worker_executing_work(last_pool, work);
>  
> -		if (worker && worker->current_pwq->wq == wq) {
> +		if (worker) {
>  			pwq = worker->current_pwq;
>  		} else {
>  			/* meh... not running there, queue here */
> 

-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2019-12-16 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12  9:15 Hillf Danton
2019-12-16 14:02 ` Michal Hocko [this message]

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=20191216140219.GD6444@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=hdanton@sina.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.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