[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250227143302.2338b1cf15919c64a6c1eb27@linux-foundation.org>
Date: Thu, 27 Feb 2025 14:33:02 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Brendan Jackman <jackmanb@...gle.com>
Cc: David Hildenbrand <david@...hat.com>, Oscar Salvador
<osalvador@...e.de>, Johannes Weiner <hannes@...xchg.org>, Vlastimil Babka
<vbabka@...e.cz>, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/page_alloc: Add lockdep assertion for pageblock type
change
On Thu, 27 Feb 2025 16:15:47 +0000 Brendan Jackman <jackmanb@...gle.com> wrote:
> Since the migratetype hygiene patches [0], the locking here is
> a bit more formalised, so write it down with an assert.
>
> ...
>
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -417,6 +417,10 @@ void set_pfnblock_flags_mask(struct page *page, unsigned long flags,
>
> void set_pageblock_migratetype(struct page *page, int migratetype)
> {
> + lockdep_assert_once(system_state == SYSTEM_BOOTING ||
> + in_mem_hotplug() ||
> + lockdep_is_held(&page_zone(page)->lock));
> +
> if (unlikely(page_group_by_mobility_disabled &&
> migratetype < MIGRATE_PCPTYPES))
> migratetype = MIGRATE_UNMOVABLE;
>
We could add such assertions all over the place. Why this place in
particular?
Powered by blists - more mailing lists