[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220705072034.GC27531@techsingularity.net>
Date: Tue, 5 Jul 2022 08:20:34 +0100
From: Mel Gorman <mgorman@...hsingularity.net>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Nicolas Saenz Julienne <nsaenzju@...hat.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
Michal Hocko <mhocko@...nel.org>,
Hugh Dickins <hughd@...gle.com>, Yu Zhao <yuzhao@...gle.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
LKML <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>
Subject: Re: [PATCH 5/7] mm/page_alloc: Protect PCP lists with a spinlock
On Mon, Jul 04, 2022 at 02:31:17PM +0200, Vlastimil Babka wrote:
> On 6/24/22 14:54, Mel Gorman wrote:
> > Currently the PCP lists are protected by using local_lock_irqsave to
> > prevent migration and IRQ reentrancy but this is inconvenient. Remote
> > draining of the lists is impossible and a workqueue is required and every
> > task allocation/free must disable then enable interrupts which is
> > expensive.
> >
> > As preparation for dealing with both of those problems, protect the lists
> > with a spinlock. The IRQ-unsafe version of the lock is used because IRQs
> > are already disabled by local_lock_irqsave. spin_trylock is used in
> > preparation for a time when local_lock could be used instead of
> > lock_lock_irqsave.
>
> ^ local_lock_irqsave?
>
More appropriate given how the series evolved would be;
spin_trylock is used in combination with local_lock_irqsave() but later
will be replaced with a spin_trylock_irqsave when the local_lock is
removed.
--
Mel Gorman
SUSE Labs
Powered by blists - more mailing lists