lkml.org 
[lkml]   [2022]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 7/7] mm/page_alloc: Replace local_lock with normal spinlock
From
On 6/16/22 23:07, Yu Zhao wrote:
> On Thu, Jun 16, 2022 at 11:02 AM Vlastimil Babka <vbabka@suse.cz> wrote:
>>
>>
>> > @@ -3794,19 +3805,29 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone,
>> > struct list_head *list;
>> > struct page *page;
>> > unsigned long flags;
>> > + unsigned long __maybe_unused UP_flags;
>> >
>> > - local_lock_irqsave(&pagesets.lock, flags);
>> > + /*
>> > + * spin_trylock_irqsave is not necessary right now as it'll only be
>> > + * true when contending with a remote drain. It's in place as a
>> > + * preparation step before converting pcp locking to spin_trylock
>> > + * to protect against IRQ reentry.
>> > + */
>> > + pcp_trylock_prepare(UP_flags);
>> > + pcp = pcp_spin_trylock_irqsave(zone->per_cpu_pageset, flags);
>> > + if (!pcp)
>>
>> Besides the missing unpin Andrew fixed, I think also this is missing
>> pcp_trylock_finish(UP_flags); ?
>
> spin_trylock only fails when trylock_finish is a NOP.

True, so it's not an active bug, but I would still add it, so it's not
confusing and depending on non-obvious details that might later change and
break the code.

\
 
 \ /
  Last update: 2022-06-17 09:58    [W:1.589 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site