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=1796242028; b=Wli+A8Aq1lCoUjk8oxAzndJ0NLHYk2LSBgiEDxupc0Bud874aAb3FTut+CPnBkyoGy/V YjY0M/AtJgbG+GRjQBvp0FtJeiS4QZ6/NcNrpsnphRdMksGHsHg75+DSD1t517Sju5Oom PEb+tX0KYdDTFalavRNpXRpMnNS/e6XfnKj8avAUmCo3mSevELLF9VtaDUt0Drd/kUvzW Fo7aNOcL2FoXAZWDC+yUe1ZActMRXg7U6rK6pvDvhMly6ieX6q9mBzISeNYZ52M9kVSiP K7Ud7TWU5j2z3QyuYV7SpO6ZyDsyXqspJJCZryikt2PzH/QCyizHd0LeEni/UfANd6g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796242028; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=FDe3mgVFcwQn17uy8mVfYgJ1JDv+cWBVZ7crIO0iNUE=; b=rKKb5ccvWkpzrKWeZAHXxesM+rjv0sGrgQbKGypyV6vDrPTKt9cfC8cEsCtk9fPHkaGx gdySNI+BUp9vTtzlS8H8d9omyTvaBy6hYIY/AYyA80R+HoGHwQETXiNI2Yny1LYW1TUhd 6/acASlsJPF36a9sVveDbXNGYdzP3/cg8Jto4eS0E60vLw9kSswA3ZVI5K56fHB6s8iaj Y9LlYmQgy4Y5z26CwTuH4BPOCjWMli2VSkuGlVSbtL0tKgfKLpkcZ9qxKfBdBg6fJTCpc cEu+MTkzAD0q69Zyz1hoclqoXXvK2+KhvOxwRchuoZWD8xt74PfUFH9Cdkt+VysLZNw== 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=VTvuIF5d; 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 58C67606A322; Wed, 2 Dec 2026 20:07:08 +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=VTvuIF5d Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B2BA1F00897; Wed, 2 Dec 2026 20:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796242027; bh=FDe3mgVFcwQn17uy8mVfYgJ1JDv+cWBVZ7crIO0iNUE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=VTvuIF5dgK5zPabaMrL/8+X8Sr4y9vdg1pZCGkdht+o0SkOTabLcrCzWRf/yOxRSp 1VmUNXZfr2a01fz2JODpBC6Hcer6peP5+EBs2nMlqjXYOjW5gcP7Cn2KhNeKnOT0kF npEZuw6H1rUe0zZZCjVXeNdXM2tsHWR8E2JMirxetdTOYu0RNJt/nvy8FqwezeM4Fb UCA+WgSf6fMXbgRrHrMttRS2qL0vTbtM0wUdUIkifub0znVIZQNGeEj8k3AADAu1P7 pcTdUc+cnUI7+01TQ3WmUCjuHYS7vCm4jOEnl07HOKig7FeRKLtqxqc2w7EUV7a0Wn f8cDU/0x5BH6g== Date: Wed, 2 Dec 2026 20:07:05 +0000 From: Harry Yoo To: "David Hildenbrand (Arm)" Cc: Muchun Song , Oscar Salvador , Andrew Morton , Jinmeng Zhou , Hongfu Li , Andrea Arcangeli , Mike Kravetz , Naoya Horiguchi , Hugh Dickins , Baolin Wang , Dave Airlie , Vivek Kasireddy , Gerd Hoffmann , Mike Rapoport , Mel Gorman , Dave McCracken , Andy Whitcroft , Adam Litke , Lorenzo Stoakes , Rik van Riel , "Liam R. Howlett" , Vlastimil Babka , Jann Horn , Lance Yang , James Houghton , Yang Shi , Suren Baghdasaryan , Shakeel Butt , Pedro Falcato , Gregory Price , Zi Yan , Joshua Hahn , Rakie Kim , Ying Huang , Matthew Brost , Byungchul Park , Alistair Popple , Wanpeng Li , Andi Kleen , Kenneth W Chen , Hugh Dickins , Michal Hocko , David Rientjes , Joern Engel , Jonathan Corbet , Shuah Khan , Randy Dunlap , Michal Hocko , "Aneesh Kumar K.V" , KAMEZAWA Hiroyuki , "Kirill A. Shutemov" , Sasha Levin , Guillaume Morin , Wanpeng Li , linux-mm@kvack.org, Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , linux-doc@vger.kernel.org, Chris Mason Subject: Re: [PATCH 01/21] mm/hugetlb: charge the copy made at fork to the parent Message-ID: References: <20261125-hugetlb_fixes_2-v1-0-db27fd2f71a8@kernel.org> <20261125-hugetlb_fixes_2-v1-1-db27fd2f71a8@kernel.org> X-Mailing-List: linux-doc@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: <20261125-hugetlb_fixes_2-v1-1-db27fd2f71a8@kernel.org> On Wed, Nov 25, 2026 at 11:32:59PM +0100, David Hildenbrand (Arm) wrote: > When copying page tables during fork(), the child is not yet assigned to > the right memcg. When copying possibly pinned anon hugetlb folios, we > must charge them to the parent's memcg, otherwise we can end up > allocating more hugetlb folios than allowed. > > Let's fix it by charging the copy to the parent's mm, like we do when > copying small folios in copy_present_page(), introducing a new helper > function alloc_hugetlb_folio_for_fork(). > > This is a hotfix for v7.4. > > Fixes: c2deb1356d82 ("mm/hugetlb: charge folios to the target mm's memcg") > Reported-by: Chris Mason > Acked-by: Michal Hocko > Signed-off-by: David Hildenbrand (Arm) > --- Might be bit late but FWIW... Looks good to me, Acked-by: Harry Yoo (Meta) -- Cheers, Harry / Hyeonggon