From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796033996; b=dOI8Jr7WnzPUEAkGHfZe9u3Sf6DQNCp/ndBdJq8Z6lwqmzFsDraqCI+sHTueI0qI3YuP 8/F4c3R5sP1zSSSmbPQS8dnoCJ7IVSN+fI+9Az5Pow3hUF3boFWjQDn9yBypLxNLiJZ6j LIQ74RPjdNpCWKRo1hc8hmpUxKSR8dW8vCmKUjYbHfCY3oQKhOANYM81qyl5gyqqSC4gH my+hqtY+RQYuL02i/9kjvrSxDcq+CnU82DlOLqz4qVwjpETNwsejFg1raVWu5TNWlz6Uj ML85xHXruXvbchbV2TD9ZbM6NRPcqPfPpA92IjXhh3RSJYK+/hfAPwhT8OXLAjFtf+w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796033996; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=VbVrZlKO5JboiLsxfGLGvMWT8kUBS7K0/Jn4ILCanOs=; b=E7p9UT4A/FVpvSc95KUyeNmjQ/QDIJtcNnanlzV83R28mG+F8Khki+SpRu8estLN2eqH 4Vl1kdKWZIQqzvYBdHE13DOu2R1ZYo6vBbh/Ak2gu5tDolVwx38jQ96iMAjUvRhNs2K5a T6OeRwQ2b80BD7tfpfM5ARjGIbfp4N/wFwLp/LGuEdXAi1Il3aJiYfS1OIsjdVXevfaQT 1PUOYpaH6WtYfgMCVqG3nu0v2FgomIZTwSGosNxj95sVyCeubbrzdCBdkDK0K5mO71pUe bkm5VujV1bRl0DyKqaKT2/cQLY26O6aSQUF3L4Avyn+B7Lph0PMRUwKK6ce3u2eG6og== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ny+0pXNo; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF232606A320 for ; Mon, 30 Nov 2026 10:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ny+0pXNo Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D5731F00898; Mon, 30 Nov 2026 10:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796033995; bh=VbVrZlKO5JboiLsxfGLGvMWT8kUBS7K0/Jn4ILCanOs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Ny+0pXNo1Pc5qQwWNjX+Wn/EgKkxVb2CmxefOTU054dPXEYUe/MCL7Vcyqn9+dwip p8Px8LbRCGZhSdRnkZ+ckyxRgBLhz36gfoveYXM3QDzYx5RN2pxFRo/g9M/aVaaahu e7oY0Yw4daXiiVulxS/BfGl0AqUMZOW0r7SMpVLJ7tjFfvQLeLPq3jpIDu1G4nrqHO qsZDIYIQSvCa5+aR99scQbCHA80MSxB0E3dk5cKXA6HB6uL5Fi1JQFYgiyjUgMl1Ne 6LsB10BHpsVwMqvPPqq5DC5PbxQmAdnZy9D9t3LoHE5eC+li2C8vq2AYaK/9sXtZmM AVEnx4xPPMsOw== Date: Mon, 30 Nov 2026 11:19:50 +0100 From: "Oscar Salvador (SUSE)" To: "David Hildenbrand (Arm)" Cc: Zhengchuan Liang , Muchun Song , Oscar Salvador , Andrew Morton , Davidlohr Bueso , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes Message-ID: References: <9a97a64f7e7aabc668499c426a2417a77d13a2f4.1795587203.git.zcliangcn@gmail.com> <650e5497-1625-4e05-afc4-9db9472262ae@kernel.org> <3a5c3796-8ab5-4516-bb3a-e1c3993d5b8a@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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) > > ... 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