* [to-be-updated] mm-page_alloc-add-lockdep-assertion-for-pageblock-type-change.patch removed from -mm tree
@ 2025-03-03 23:19 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-03-03 23:19 UTC (permalink / raw)
To: mm-commits, vbabka, osalvador, hannes, david, jackmanb, akpm
The quilt patch titled
Subject: mm/page_alloc: add lockdep assertion for pageblock type change
has been removed from the -mm tree. Its filename was
mm-page_alloc-add-lockdep-assertion-for-pageblock-type-change.patch
This patch was dropped because an updated version will be issued
------------------------------------------------------
From: Brendan Jackman <jackmanb@google.com>
Subject: mm/page_alloc: add lockdep assertion for pageblock type change
Date: Thu, 27 Feb 2025 16:15:47 +0000
Since the migratetype hygiene patches [0], the locking here is
a bit more formalised, so write it down with an assert.
[0] https://lore.kernel.org/lkml/20240320180429.678181-3-hannes@cmpxchg.org/T/
Link: https://lkml.kernel.org/r/20250227-pageblock-lockdep-v1-1-3701efb331bb@google.com
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/memory_hotplug.h | 1 +
mm/memory_hotplug.c | 5 +++++
mm/page_alloc.c | 4 ++++
3 files changed, 10 insertions(+)
--- a/include/linux/memory_hotplug.h~mm-page_alloc-add-lockdep-assertion-for-pageblock-type-change
+++ a/include/linux/memory_hotplug.h
@@ -175,6 +175,7 @@ void put_online_mems(void);
void mem_hotplug_begin(void);
void mem_hotplug_done(void);
+bool in_mem_hotplug(void);
/* See kswapd_is_running() */
static inline void pgdat_kswapd_lock(pg_data_t *pgdat)
--- a/mm/memory_hotplug.c~mm-page_alloc-add-lockdep-assertion-for-pageblock-type-change
+++ a/mm/memory_hotplug.c
@@ -267,6 +267,11 @@ void mem_hotplug_done(void)
cpus_read_unlock();
}
+bool in_mem_hotplug(void)
+{
+ return percpu_is_write_locked(&mem_hotplug_lock);
+}
+
u64 max_mem_size = U64_MAX;
/* add this memory to iomem resource */
--- a/mm/page_alloc.c~mm-page_alloc-add-lockdep-assertion-for-pageblock-type-change
+++ a/mm/page_alloc.c
@@ -417,6 +417,10 @@ void set_pfnblock_flags_mask(struct page
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;
_
Patches currently in -mm which might be from jackmanb@google.com are
mm-mmu_gather-update-comment-on-rcu-freeing.patch
selftests-mm-report-errno-when-things-fail-in-gup_longterm.patch
selftests-mm-fix-assumption-that-sudo-is-present.patch
selftests-mm-skip-uffd-stress-if-userfaultfd-not-available.patch
selftests-mm-skip-uffd-wp-mremap-if-userfaultfd-not-available.patch
selftests-mm-uffd-rename-nr_cpus-nr_threads.patch
selftests-mm-print-some-details-when-uffd-stress-gets-bad-params.patch
selftests-mm-dont-fail-uffd-stress-if-too-many-cpus.patch
selftests-mm-skip-map_populate-on-weird-filesystems.patch
selftests-mm-skip-gup_longerm-tests-on-weird-filesystems.patch
mm-page_alloc-warn-on-nr_reserved_highatomic-underflow.patch
mm-page_alloc-clarify-terminology-in-migratetype-fallback-code.patch
mm-page_alloc-clarify-should_claim_block-commentary.patch
scripts-gdb-add-lx_per_cpu_ptr.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-03 23:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 23:19 [to-be-updated] mm-page_alloc-add-lockdep-assertion-for-pageblock-type-change.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.