linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Harry Yoo <harry.yoo@oracle.com>,
	David Rientjes <rientjes@google.com>,
	 Christoph Lameter <cl@gentwo.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	 "linux-mm@kvack.org" <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	 Christoph Hellwig <hch@infradead.org>
Subject: Re: [GIT PULL] slab fix for 6.18-rc7
Date: Thu, 20 Nov 2025 13:37:36 -0800	[thread overview]
Message-ID: <CAHk-=whk_gUfFKtZrjd6TbaR0YhEmhOAs9wXFg5Je3FzQ3adAw@mail.gmail.com> (raw)
In-Reply-To: <aR913JM35YDVSCjF@casper.infradead.org>

On Thu, 20 Nov 2025 at 12:11, Matthew Wilcox <willy@infradead.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 */


  reply	other threads:[~2025-11-20 21:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 18:45 Vlastimil Babka
2025-11-20 18:58 ` Linus Torvalds
2025-11-20 20:11   ` Matthew Wilcox
2025-11-20 21:37     ` Linus Torvalds [this message]
2025-11-20 21:55       ` Linus Torvalds
2025-11-20 19:00 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHk-=whk_gUfFKtZrjd6TbaR0YhEmhOAs9wXFg5Je3FzQ3adAw@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=harry.yoo@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox