Re: [PATCH v3 5/7] mm: Remember young/dirty bit for page migrations

From: Dave Hansen
Date: Thu Aug 18 2022 - 12:40:50 EST


On 8/15/22 14:03, Nadav Amit wrote:
>>
>> At least on x86, the hardware is not supposed to do so. The only case I
>> remember (and sometimes misremembers) is with KNL erratum, which perhaps
>> needs to be considered:
>>
>> https://lore.kernel.org/all/20160708001911.9A3FD2B6@xxxxxxxxxxxxxxxxxx/
> I keep not remembering this erratum correctly. IIRC, the erratum says that
> the access/dirty might be set, but it does not mean that a write is possible
> after the PTE is cleared (i.e., the dirty/access might be set on the
> non-present PTE, but the access itself would fail). So it is not an issue in
> this case - losing A/D would not impact correctness since the access should
> fail.
>
> Dave Hansen hates when I get confused with this one, but I cc him if he
> wants to confirm.

Right.

The issue is strictly with the page walker setting Accessed/Dirty in a
racy way. The TLB still has accurate contents at all times.