mm: damon must atomically 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 validate (and potentially modify) the operation. Fixes: 46c3a0ac ("mm/damon/vaddr: separate commonly usable functions") Signed-off-by:Ryan Roberts <ryan.roberts@arm.com>
Loading
Please register or sign in to comment