[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d3ac62ae-740a-5261-2762-7d8120fb8fd2@suse.cz>
Date: Tue, 26 Apr 2022 18:48:52 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Nicolas Saenz Julienne <nsaenzju@...hat.com>,
Mel Gorman <mgorman@...hsingularity.net>
Cc: Marcelo Tosatti <mtosatti@...hat.com>,
Michal Hocko <mhocko@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>
Subject: Re: [PATCH 5/6] mm/page_alloc: Protect PCP lists with a spinlock
On 4/26/22 18:42, Nicolas Saenz Julienne wrote:
> On Wed, 2022-04-20 at 10:59 +0100, Mel Gorman wrote:
>> @@ -3082,15 +3093,22 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
>> */
>> void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp)
>> {
>> - unsigned long flags;
>> int to_drain, batch;
>>
>> - local_lock_irqsave(&pagesets.lock, flags);
>> batch = READ_ONCE(pcp->batch);
>> to_drain = min(pcp->count, batch);
>> - if (to_drain > 0)
>> + if (to_drain > 0) {
>> + unsigned long flags;
>> +
>> + /* free_pcppages_bulk expects IRQs disabled for zone->lock */
>> + local_irq_save(flags);
>
> Why dropping the local_lock? That approach is nicer to RT builds, and I don't
> think it makes a difference from a non-RT perspective.
I think the separate irq_disable+spin_lock here is actually broken on RT
config, as explained in Documentation/locking/locktypes.rst. pcp->lock would
have to be a raw_spin_lock.
> That said, IIUC, this will eventually disappear with subsequent patches, right?
So it wouldn't be mergeable even as a temporary step.
>
>> +
>> + spin_lock(&pcp->lock);
>> free_pcppages_bulk(zone, to_drain, pcp, 0);
>> - local_unlock_irqrestore(&pagesets.lock, flags);
>> + spin_unlock(&pcp->lock);
>> +
>> + local_irq_restore(flags);
>> + }
>> }
>> #endif
>>
Powered by blists - more mailing lists