Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, prsood@codeaurora.org,
	sramana@codeaurora.org
Subject: Re: [PATCH] workqueue: Handle race between wake up and rebind
Date: Tue, 16 Jan 2018 09:35:34 -0800	[thread overview]
Message-ID: <20180116173534.GR3460072@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <1516005492-4994-1-git-send-email-neeraju@codeaurora.org>

Hello, Neeraj.

On Mon, Jan 15, 2018 at 02:08:12PM +0530, Neeraj Upadhyay wrote:
> - kworker/0:0 gets chance to run on cpu1; while processing
>   a work, it goes to sleep. However, it does not decrement
>   pool->nr_running. This is because WORKER_REBOUND (NOT_
>   RUNNING) flag was cleared, when worker entered worker_

Do you mean that because REBOUND was set?

>   thread().
> 
>   Worker 0 runs on cpu1
>     worker_thread()
>       process_one_work()
>         wq_worker_sleeping()
>           if (worker->flags & WORKER_NOT_RUNNING)
>             return NULL;
>           if (WARN_ON_ONCE(pool->cpu != raw_smp_processor_id()))
>             <Does not decrement nr_running>
> 
> - After this, when kworker/0:0 wakes up, this time on its
>   bounded cpu cpu0, it increments pool->nr_running again.
>   So, pool->nr_running becomes 2.

Why is it suddenly 2?  Who made it one on the account of the kworker?

Do you see this happening?  Or better, is there a (semi) reliable
repro for this issue?

Thanks.

-- 
tejun

  reply	other threads:[~2018-01-16 17:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15  8:38 [PATCH] workqueue: Handle race between wake up and rebind Neeraj Upadhyay
2018-01-16 17:35 ` Tejun Heo [this message]
2018-01-16 20:08   ` Neeraj Upadhyay
2018-01-18  3:02     ` Lai Jiangshan
2018-01-18 10:07       ` Neeraj Upadhyay

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=20180116173534.GR3460072@devbig577.frc2.facebook.com \
    --to=tj@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraju@codeaurora.org \
    --cc=prsood@codeaurora.org \
    --cc=sramana@codeaurora.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