Skip to content
Commit d55365b5 authored by Ryan Roberts's avatar Ryan Roberts
Browse files

mm/damon/ops-common: atomically test and clear young on ptes and pmds



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 check (and potentially
modify) the operation.

Fixes: 3f49584b ("mm/damon: implement primitives for the virtual memory address spaces").
Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
Reviewed-by: default avatarZi Yan <ziy@nvidia.com>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Reviewed-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
parent 94815705
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment