On 6/5/26 11:35, Breno Leitao wrote:
> On Wed, Jun 03, 2026 at 10:33:04AM +0800, Miaohe Lin wrote:
>> On 2026/6/2 17:41, David Hildenbrand (Arm) wrote:
>>>
>>> Races are fine. We might miss some pages, but that can happen on races 
>>> either way.
>>>
>>>
>>> I'd just do something like
>>>
>>> if (PageReserved(page))
>>>     return true;
>>>
>>> head = compound_head(page);
>>
>> If @head is split just after compound_head. And then @head is freed into 
>> buddy and re-allocated as slab
>> page while @page is still in the buddy. We would panic on this scene as 
>> @head is PageSlab. But we were
>> supposed to successfully handle @page. Or am I miss something?
> 
> You're right that it is racy, but I think it is an acceptable race here.
> 

I mean, any such races can currently already happen one way or the other?

Really, the only way to not get races is to tryget the (compound)page,
revalidate that the page is still part of the compound page.

I'm not sure if that's really a good idea.

But my memory is a bit vague in which scenarios we already hold a page reference
here to prevent any concurrent freeing?

-- 
Cheers,

David

Reply via email to