All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Oscar Salvador (SUSE)" <osalvador@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Zhengchuan Liang <zcliangcn@gmail.com>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Davidlohr Bueso <davidlohr@hp.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes
Date: Mon, 30 Nov 2026 11:19:50 +0100	[thread overview]
Message-ID: <aw1NxmIse7AeZofC@localhost.localdomain> (raw)
In-Reply-To: <3a5c3796-8ab5-4516-bb3a-e1c3993d5b8a@kernel.org>

On Sun, Nov 29, 2026 at 11:35:06AM +0100, David Hildenbrand (Arm) wrote:
> On 11/26/26 12:20, David Hildenbrand (Arm) wrote:
> > On 11/25/26 07:15, Zhengchuan Liang wrote:
> >> --- a/mm/hugetlb.c
> >> +++ b/mm/hugetlb.c
> >> @@ -6091,13 +6091,8 @@ static vm_fault_t hugetlb_no_page(struct address_space *mapping,
> >>  #ifdef CONFIG_SMP
> >>  u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx)
> >>  {
> >> -	unsigned long key[2];
> >> -	u32 hash;
> >> -
> >> -	key[0] = (unsigned long) mapping;
> >> -	key[1] = idx;
> >> -
> >> -	hash = jhash2((u32 *)&key, sizeof(key)/(sizeof(u32)), 0);
> >> +	u32 seed = HUGETLBFS_I(mapping->host)->fault_mutex_hash_seed;
> >> +	u32 hash = jhash2((u32 *)&idx, sizeof(idx) / sizeof(u32), seed);
> > 
> > Both can be const.
> 
> Can you fix that up and add my
> 
> Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
> 
> ... and add some more details about what we leak and how you reproduced that?
> 
> ... and then resend? Maybe that makes it easier to get hugetlb maintainer's
> attention :)

Sorry, lots of hugetlb fixes lately

Current version with the const fixups LGTM, I will add my ack later.
Just wanted to ask about the suggestion of using the inode number. Does not that
provide enough randomness?



-- 
Oscar Salvador
SUSE Labs


  reply	other threads:[~2026-11-30 10:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  6:15 [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes Zhengchuan Liang
2026-11-25 11:58 ` David Hildenbrand (Arm)
2026-11-25 18:59   ` Zhengchuan Liang
2026-11-26 11:17     ` David Hildenbrand (Arm)
2026-11-27  0:13       ` Zhengchuan Liang
2026-11-26 11:20 ` David Hildenbrand (Arm)
2026-11-29 10:35   ` David Hildenbrand (Arm)
2026-11-30 10:19     ` Oscar Salvador (SUSE) [this message]
2026-11-30 10:42       ` David Hildenbrand (Arm)
2026-11-30 19:08 ` Oscar Salvador (SUSE)

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=aw1NxmIse7AeZofC@localhost.localdomain \
    --to=osalvador@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=davidlohr@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=osalvador@suse.de \
    --cc=zcliangcn@gmail.com \
    /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.