[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whk_gUfFKtZrjd6TbaR0YhEmhOAs9wXFg5Je3FzQ3adAw@mail.gmail.com>
Date: Thu, 20 Nov 2025 13:37:36 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Vlastimil Babka <vbabka@...e.cz>, Andrew Morton <akpm@...ux-foundation.org>,
Harry Yoo <harry.yoo@...cle.com>, David Rientjes <rientjes@...gle.com>,
Christoph Lameter <cl@...two.org>, Roman Gushchin <roman.gushchin@...ux.dev>,
"linux-mm@...ck.org" <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@...radead.org>
Subject: Re: [GIT PULL] slab fix for 6.18-rc7
On Thu, 20 Nov 2025 at 12:11, Matthew Wilcox <willy@...radead.org> wrote:
>
> Would you rather see something like this that hides the fact it's
> dealing with HIGHMEM?
NO!
I would rather see us stop writing WORSE CODE due to the abomination
that is HIGHMEM.
> @@ -67,11 +67,19 @@ static void check_element(mempool_t *pool, void *element)
You just added more lines of code to deal with something that we
shouldn't spend one second of time on, and that we should *not* write
more complex code for.
IOW, I think what should happen is just something like below. IOW,
just remove the useless garbage.
Think of it as a small step towards the eventual bright future that is
lack of HIGHMEM.
HIGHMEM was a mistake forced on us by bad hardware. We should revel in
the fact that it is not really relevant any more.
Linus
---
diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug
index 32b65073d0cc..ecfb65c09651 100644
--- a/mm/Kconfig.debug
+++ b/mm/Kconfig.debug
@@ -58,7 +58,7 @@ config SLUB_DEBUG
config SLUB_DEBUG_ON
bool "SLUB debugging on by default"
- depends on SLUB_DEBUG
+ depends on SLUB_DEBUG && !HIGHMEM
select STACKDEPOT_ALWAYS_INIT if STACKTRACE_SUPPORT
default n
help
diff --git a/mm/mempool.c b/mm/mempool.c
index d7bbf1189db9..22157d23cdd9 100644
--- a/mm/mempool.c
+++ b/mm/mempool.c
@@ -12,7 +12,6 @@
#include <linux/mm.h>
#include <linux/slab.h>
-#include <linux/highmem.h>
#include <linux/kasan.h>
#include <linux/kmemleak.h>
#include <linux/export.h>
@@ -68,20 +67,9 @@ static void check_element(mempool_t *pool, void *element)
} else if (pool->free == mempool_free_pages) {
/* Mempools backed by page allocator */
int order = (int)(long)pool->pool_data;
-
-#ifdef CONFIG_HIGHMEM
- for (int i = 0; i < (1 << order); i++) {
- struct page *page = (struct page *)element;
- void *addr = kmap_local_page(page + i);
-
- __check_element(pool, addr, PAGE_SIZE);
- kunmap_local(addr);
- }
-#else
void *addr = page_address((struct page *)element);
__check_element(pool, addr, PAGE_SIZE << order);
-#endif
}
}
@@ -107,20 +95,9 @@ static void poison_element(mempool_t *pool, void *element)
} else if (pool->alloc == mempool_alloc_pages) {
/* Mempools backed by page allocator */
int order = (int)(long)pool->pool_data;
-
-#ifdef CONFIG_HIGHMEM
- for (int i = 0; i < (1 << order); i++) {
- struct page *page = (struct page *)element;
- void *addr = kmap_local_page(page + i);
-
- __poison_element(addr, PAGE_SIZE);
- kunmap_local(addr);
- }
-#else
void *addr = page_address((struct page *)element);
__poison_element(addr, PAGE_SIZE << order);
-#endif
}
}
#else /* CONFIG_SLUB_DEBUG_ON */
Powered by blists - more mailing lists