[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250225150940.GB1499716@cmpxchg.org>
Date: Tue, 25 Feb 2025 10:09:40 -0500
From: Johannes Weiner <hannes@...xchg.org>
To: Brendan Jackman <jackmanb@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] mm: page_alloc: remove remnants of unlocked
migratetype updates
On Tue, Feb 25, 2025 at 01:43:35PM +0000, Brendan Jackman wrote:
> On Mon, Feb 24, 2025 at 07:08:25PM -0500, Johannes Weiner wrote:
> > The freelist hygiene patches made migratetype accesses fully protected
> > under the zone->lock. Remove remnants of handling the race conditions
> > that existed before from the MIGRATE_HIGHATOMIC code.
> >
> > Signed-off-by: Johannes Weiner <hannes@...xchg.org>
>
> Aside from my WARN bikeshedding, which isn't really about this patch
> anyway:
>
> Reviewed-by: Brendan Jackman <jackmanb@...gle.com>
Thanks
> > - if (is_migrate_highatomic(mt)) {
> > - unsigned long size;
> > - /*
> > - * It should never happen but changes to
> > - * locking could inadvertently allow a per-cpu
> > - * drain to add pages to MIGRATE_HIGHATOMIC
> > - * while unreserving so be safe and watch for
> > - * underflows.
> > - */
> > - size = max(pageblock_nr_pages, 1UL << order);
> > - size = min(size, zone->nr_reserved_highatomic);
> > - zone->nr_reserved_highatomic -= size;
> > - }
> > + size = max(pageblock_nr_pages, 1UL << order);
> > + size = min(size, zone->nr_reserved_highatomic);
> > + zone->nr_reserved_highatomic -= size;
>
> Now that the locking is a bit cleaner, would it make sense to add a
> [VM_]WARN_ON[_ONCE] for underflow?
Yeah I think that would be a nice additional cleanup. Do you want to
send a patch? Otherwise, I can.
Powered by blists - more mailing lists