From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A2A52DE702 for ; Thu, 30 Jul 2026 01:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785373364; cv=none; b=iEHNxXI+6FF3qh5RHeaG15A1bjInFHXnTnBteV7xSdaGzIduVWuWZYLrZYMWCyjszzhuGyNGVamSmPKEbLglYF6FWPqmu3EFsvgpLdvl7qylzW/8lqfjyvlnWz4vDJutosKRQ0yQqcgU4Q8dFg93HIodWhsm9uFc8FhSEyN3xqs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785373364; c=relaxed/simple; bh=ber5h4JN9ve8txUAKbByeesTNvYfjEjyrVEpAHS2OJk=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=bjg2X98pS0dKsIAShg6X2Rfl915olPidexAVXrwwnH4MI6vf7y1HeBVZPwHshPXx7VTogmA7Q+hvx8FjoeedSBUOH1t/kYm+obIcSC36WAOlInes+zNEsL1SnCLSpsPoG5+7LQG5BUokWkspv3l1F/+X0e5p05NhWNrmVUgKv8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=RkaxOLGY; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="RkaxOLGY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 137161F000E9; Thu, 30 Jul 2026 01:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1785373362; bh=JKS0B12CjE/o8N1gbs5VdqTnXRPU5U8YKsog3scuw+A=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=RkaxOLGYcTsZH3TOBiDLha67pIQvWbABhJls6CJaK6Daw3XnIdsNi9ANVccmPbBDF eYo7eDv6udeYGWQhqWZZ7ddjuO4FWEKgkiB6cQ++2OjQigbGpa+asLinhcd6prvRsl Wwo/wQisCmBtHtMR3Em5O+0Fghm7lp/C9D903fm4= Date: Wed, 29 Jul 2026 18:02:41 -0700 From: Andrew Morton To: "David Hildenbrand (Arm)" Cc: xueyuan.chen@vivo.com, Lorenzo Stoakes , linux-mm@kvack.org, Zi Yan , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Kiryl Shutsemau , Bob Liu , linux-kernel@vger.kernel.org, Xueyuan Chen Subject: Re: [PATCH] mm/huge_memory: fix huge zero folio publication race Message-Id: <20260729180241.2b8bcb2379b975b22c48d251@linux-foundation.org> In-Reply-To: <37c40d62-51e2-45b4-9837-a4b96d1640b3@kernel.org> References: <4ee89c27873fb4d9e598f8a5cfe71d700ecf894e.1785300563.git.xueyuan.chen@vivo.com> <37c40d62-51e2-45b4-9837-a4b96d1640b3@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 29 Jul 2026 08:44:12 +0200 "David Hildenbrand (Arm)" wrote: > > --- a/mm/huge_memory.c > > +++ b/mm/huge_memory.c > > @@ -245,8 +245,11 @@ static bool get_huge_zero_folio(void) > > } > > WRITE_ONCE(huge_zero_pfn, folio_pfn(zero_folio)); > > > > - /* We take additional reference here. It will be put back by shrinker */ > > - atomic_set(&huge_zero_refcount, 2); > > + /* > > + * Publish the folio and PFN before making them available to lockless > > + * users. Pairs with a successful atomic_inc_not_zero() above. > > + */ > > + atomic_set_release(&huge_zero_refcount, 2); > > preempt_enable(); > > count_vm_event(THP_ZERO_PAGE_ALLOC); > > return true; > > https://lore.kernel.org/r/20260728-fix-refcounted-huge-zero-v1-0-3f261f5447b4@kernel.org Does that actually fix the same thing? Is so, Xueyuan's Fixes: is 97ae17497e99 ("thp: implement refcounting for huge zero page"). Which to believe?