From: Petr Mladek <pmladek@suse.com>
To: akpm@linux-foundation.org
Cc: tj@kernel.org, hdanton@sina.com,
Zqiang <qiang.zhang@windriver.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v4] kthread_worker: Prevent queuing delayed work from timer_fn when it is being canceled
Date: Thu, 15 Oct 2020 14:38:15 +0200 [thread overview]
Message-ID: <20201015123815.GE8871@alley> (raw)
In-Reply-To: <20201014075048.15473-1-qiang.zhang@windriver.com>
On Wed 2020-10-14 15:50:48, Zqiang wrote:
> There is a small race window when a delayed work is being canceled and
> the work still might be queued from the timer_fn:
>
> CPU0 CPU1
> kthread_cancel_delayed_work_sync()
> __kthread_cancel_work_sync()
> __kthread_cancel_work()
> work->canceling++;
> kthread_delayed_work_timer_fn()
> kthread_insert_work();
>
> BUG: kthread_insert_work() should not get called when work->canceling
> is set.
>
> Cc: <stable@vger.kernel.org>
> Reviewed-by: Petr Mladek <pmladek@suse.com>
> Acked-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Zqiang <qiang.zhang@windriver.com>
Andrew, are you going to take this patch with -mm tree, please?
I think that you usually take the changes in kthread.c.
Best Regards,
Petr
next prev parent reply other threads:[~2020-10-15 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-14 7:50 Zqiang
2020-10-15 12:38 ` Petr Mladek [this message]
2020-10-14 8:30 qiang.zhang
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=20201015123815.GE8871@alley \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=qiang.zhang@windriver.com \
--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