Re: [PATCH 0/2] mm: memory-failure: fix HWPoison flag race with non-atomic page flag ops
From: David Hildenbrand (Arm)
Date: Wed Jul 01 2026 - 04:42:06 EST
On 7/1/26 10:33, Michael S. Tsirkin wrote:
> On Wed, Jul 01, 2026 at 10:26:26AM +0200, David Hildenbrand (Arm) wrote:
>> On 7/1/26 10:18, Michael S. Tsirkin wrote:
>>>
>>> So on this idea. It might not matter. What I had in mind is:
>>> 1. run the current logic
>>> 2. add page to a list of pages to check, then invoke e.g. call_rcu_tasks
>>> (or call_rcu_tasks_rude) maybe
>>> 3. in the callback, recheck and if poison cleared, go back to 1
>>> 4. otherwise everyone will see the bit set, remove from list we are done
>>>
>>> it seems to not regress anything, and for the rare race, we set
>>> the bit eventually.
>>>
>>
>> So test-and-set (and friends) would also have to check the data structure that
>> remembers bit to set/clear (and possibly update the data structure).
>>
>> That does seem doable. Do you have a prototype?
>
> what do you think ;) post it?
As RFC please :) [and if it's AI generated, obviously properly reviewed and
reworked by you]
--
Cheers,
David