All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Amir Hosseini <me@amir.fyi>
Cc: akpm@linux-foundation.org, edumazet@kernel.org,
	davem@davemloft.net, brauner@kernel.org, muchun.song@linux.dev,
	linux-mm@kvack.org, netdev@vger.kernel.org
Subject: Re: [PATCH] mm/mm_init: don't shrink large system hash tables below low_limit
Date: Wed, 2 Dec 2026 10:47:04 +0200	[thread overview]
Message-ID: <aw_bCJZhudF59_HQ@kernel.org> (raw)
In-Reply-To: <20261201182438.2672909-1-me@amir.fyi>

On Tue, Dec 01, 2026 at 06:24:38PM +0000, Amir Hosseini wrote:
> On Tue, Dec 01, 2026 at 04:55:03PM +0200, Mike Rapoport wrote:
> > Since that table is allocated in an initcall why not simply replace it with
> > kvmalloc_array()?
> 
> Good idea, that's much simpler. I tested it with the same fail_page_alloc
> setup and the crash is gone. I'll send a patch.
> 
> > You are right that the loop should respect the low_limit, but the entire
> > alloc_large_system_hash() is quite convoluted and I believe it requires
> > more drastic refactoring.
> 
> TCP is where I hit this, but UDP depends on low_limit too.
> udp_lib_get_port() keeps a bitmap on the stack that assumes at least 128
> slots, so if the table shrinks to 64 it writes past the end. KASAN catches
> it on a bind to port 0. This is very unlikely in practice. I can send a
> small patch that just stops the loop at low_limit, unless you prefer to
> fold it into your cleanup.

Yes, please.
A small patch can be backported, a larger cleanup can't :)
 
> Thanks,
> Amir

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2026-12-02  8:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 20:15 [PATCH] mm/mm_init: don't shrink large system hash tables below low_limit Amir Hosseini via B4 Relay
2026-11-23 20:15 ` Amir Hosseini
2026-11-26 13:02 ` Mike Rapoport
2026-11-29 23:13   ` Amir Hosseini
2026-12-01 14:55     ` Mike Rapoport
2026-12-01 18:24       ` Amir Hosseini
2026-12-02  8:47         ` Mike Rapoport [this message]
2026-11-30 16:14   ` Christian Brauner

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=aw_bCJZhudF59_HQ@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=me@amir.fyi \
    --cc=muchun.song@linux.dev \
    --cc=netdev@vger.kernel.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 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.