[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9F292AC7-6632-437B-9F9F-DB3CC10240E7@nvidia.com>
Date: Thu, 11 May 2023 11:01:12 -0400
From: Zi Yan <ziy@...dia.com>
To: Ryan Roberts <ryan.roberts@....com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
SeongJae Park <sj@...nel.org>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, damon@...ts.linux.dev
Subject: Re: [RESEND PATCH v1 2/5] mm: damon must atomically clear young on
ptes and pmds
On 11 May 2023, at 9:21, Ryan Roberts wrote:
> It is racy to non-atomically read a pte, then clear the young bit, then
> write it back as this could discard dirty information. Further, it is
> bad practice to directly set a pte entry within a table. Instead
> clearing young must go through the arch-provided helper,
> ptep_test_and_clear_young() to ensure it is modified atomically and to
> give the arch code visibility and allow it to validate (and potentially
> modify) the operation.
>
> Fixes: 46c3a0accdc4 ("mm/damon/vaddr: separate commonly usable functions")
> Signed-off-by: Ryan Roberts <ryan.roberts@....com>
> ---
> mm/damon/ops-common.c | 16 ++++++----------
> mm/damon/ops-common.h | 4 ++--
> mm/damon/paddr.c | 4 ++--
> mm/damon/vaddr.c | 4 ++--
> 4 files changed, 12 insertions(+), 16 deletions(-)
>
LGTM. Reviewed-by: Zi Yan <ziy@...dia.com>
--
Best Regards,
Yan, Zi
Download attachment "signature.asc" of type "application/pgp-signature" (855 bytes)
Powered by blists - more mailing lists