From: Greg KH <gregkh@linuxfoundation.org>
To: SeongJae Park <sj@kernel.org>
Cc: stable@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 6.5.y] mm/damon/sysfs: check DAMOS regions update progress from before_terminate()
Date: Tue, 31 Oct 2023 12:16:06 +0100 [thread overview]
Message-ID: <2023103157-rebuttal-directed-7f83@gregkh> (raw)
In-Reply-To: <20231028213936.45621-1-sj@kernel.org>
On Sat, Oct 28, 2023 at 09:39:36PM +0000, SeongJae Park wrote:
> DAMON_SYSFS can receive DAMOS tried regions update request while kdamond
> is already out of the main loop and before_terminate callback
> (damon_sysfs_before_terminate() in this case) is not yet called. And
> damon_sysfs_handle_cmd() can further be finished before the callback is
> invoked. Then, damon_sysfs_before_terminate() unlocks damon_sysfs_lock,
> which is not locked by anyone. This happens because the callback function
> assumes damon_sysfs_cmd_request_callback() should be called before it.
> Check if the assumption was true before doing the unlock, to avoid this
> problem.
>
> Link: https://lkml.kernel.org/r/20231007200432.3110-1-sj@kernel.org
> Fixes: f1d13cacabe1 ("mm/damon/sysfs: implement DAMOS tried regions update command")
> Signed-off-by: SeongJae Park <sj@kernel.org>
> Cc: <stable@vger.kernel.org> [6.2.x]
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> (cherry picked from commit 76b7069bcc89dec33f03eb08abee165d0306b754)
> ---
>
> I sent this patch yesterday, but seems not archived in lore.kernel.org.
> Sending again Cc-ing more mailing lists, to ensure it is sent and others can
> find it, to avoid any duplicated works.
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2023-10-31 11:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2023102716-prudishly-reggae-1b29@gregkh>
2023-10-28 21:39 ` [PATCH RESEND 6.5.y] mm/damon/sysfs: check DAMOS regions update progress from before_terminate() SeongJae Park
2023-10-31 11:16 ` Greg KH [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=2023103157-rebuttal-directed-7f83@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
--cc=stable@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).