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=1793104280; b=jViA4cUS06RY+rGyBKM/h8BihrJd6xCo3A1DJ95S6U6Fnsj1QaPAeSpAvXdIovWEP2Tr JAhuHIJmvzmC3fQfz88qGBl/hxzkPVxz/YDwwjpLvtMCPJ+PdY6HSZ1YZo+rZ5AzZRuhf OYpW1iQmoKAWxX1DoOfA8MnyaNgjkSDQY1y0D5XRAVnDyCfmyPcmUjYkB+WhAKXPMSfRA sDAyh37rkh2wKQP+93Eu4tACqQTgMN140yIROl2ifEdq2TMJJ/OxkrwCEu8xcrmzrzE7Q TEUK7CA9OOhp8B08aemVdkTgkGQPZNEDcZz3pTLIFfJPKdK5W+qGpqiSbocRLRVn3QQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793104280; h=Received:DKIM-Signature:Received:Received:X-ME-Sender:X-ME-Received: X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=JA8h9KUew4bMbADI2oUInBzixioja4qGJWsGZbSCJpI=; b=VXduTueXIcj1Vh8qK36Qy5G0MAyI83U1s+l1RsT48aelsX1KwexuutLxhiFBcJLmQxXa 4E16YLXmsne9B9E10EbKxW+2QKxIMRfp0CUujQmduoUT05+X02nY5cVy2h9CZYQpwQyuL g8eKpeiMhVuNkjfMsvOTSBYl9in3KxluU/EEYq/wlQwpeQzXVmQfQBsvjQV5HJPG9DU1S 4RAEs5GtfNLkGtCIGahlLSz25OAS4c2snwUQN23tcuzDXdPHh6jseuaG+Ryy40MyE/1al BNyKdADqyKFZ4JvSUM+Ll9tAmwbC2DwsdTirjt3mF2lJwzsgszdv3WAhigzQTyWX/pQ== 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=fdlPxkHc; 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 E075B606AA2C for ; Tue, 27 Oct 2026 12:31:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fdlPxkHc Received: by smtp.kernel.org (Postfix) with ESMTPSA id D41541F031E3; Tue, 27 Oct 2026 12:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793104279; bh=JA8h9KUew4bMbADI2oUInBzixioja4qGJWsGZbSCJpI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=fdlPxkHcRWR5vIjf+FkVNVYAWLRjlXa1UA/EkgWQPWGXfy2VMgeNXe9Lx1/4Euday iLMMKDcWqXlGYbQHFDvjkIFpcq6fsBp/284V+Q1rUjKACna1xKBb5gJGAfi71MW/tU 061+/HAODvw+LuiYUJxUSWYd6lxEjdkHVwTvKsBRB2SQw9hlibBHcJDp542t0A7yjY Ltcf8+j+8exOlJAxcV303BfaafVeoTCKFYfvTy7nMMEzindwLWjVfb4X+uS2rZl/V3 vZ94rdcKTpHgZwHyULF7X05UQDFxmAaRBrVQg+zxrIAwF5vLagySxromZp9WwFevI/ b9vw+VNle52dQ== Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfauth.ams.internal (Postfix) with ESMTP id C4148198003A; Tue, 27 Oct 2026 08:31:11 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 27 Oct 2026 08:31:16 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFr3RumHCfbQTlQHvPlXFybAsM2kuRamaLK+DcsHGJnUk2aCjGXXyr6NKWi0kroSr Oe85i3AcnkoxYUwKMUsCnYv3ol8I9M8cSn01GHV9AOTm5NfBjd+kCIjHiud1PAPzD5uXXl fN+b6rTVdtgXXvR1Z8eNRwhKI9yHxfQGGUEg7jRZegVt2fzj4kjjkHnB7T87ApQJ/YAHeu jWBHnlmzJHluxF9tAeEQxnoK263SXj0iYueuHFhGeOpOuCn6b2DvTIZwBEgN/+EwunXjB8 CwEWM/ocJ/P7R/h2BXkq5SQ2kHartw+7bNjA0Gxa9vs0WmUsZFcGkZnIAoPCICn1WzThUZ qOz0AVGhp67x0YgaM1Ydxlnbw0N39OED89qvX5lcwiSM/HqWSxoVFWvTjUWcewSd7SviP7 dQ04WcBrJE49hc8irsEuh6Xa8qmKhTv5+27sFoWEYs8ENR5FLW6D7hiRnsGUpkMI5MQceB UY8D9iJZ2kbY+0kfGnpFDbFzlSAgxEsNQH68IGiYsMcu566/hZL7hfXo0u3QYxpuXTE7Lf O/lVEviaducfFiifqy28iVecFxFVMJPrtttgxyJ2XsNCKh4pSCNIqqAiDWXSVimljJQasr nahIdUaatb5eDNRDlsczlK7MH5d2+R1Yg4ux3pWMJw8eTuDTZQQKwN8030Jg X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 Oct 2026 08:31:10 -0400 (EDT) Date: Tue, 27 Oct 2026 12:31:09 +0000 From: Kiryl Shutsemau To: "David Hildenbrand (Arm)" Cc: Peter Zijlstra , Andrew Morton , Muchun Song , Matthew Wilcox , Usama Arif , Frank van der Linden , Oscar Salvador , Mike Rapoport , Vlastimil Babka , Lorenzo Stoakes , Zi Yan , Baoquan He , Michal Hocko , Johannes Weiner , Jonathan Corbet , Huacai Chen , WANG Xuerui , Palmer Dabbelt , Paul Walmsley , Albert Ou , Alexandre Ghiti , kernel-team@meta.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, loongarch@lists.linux.dev, linux-riscv@lists.infradead.org, Dave Hansen , Andy Lutomirski Subject: Re: [PATCHv7 13/18] mm: Drop fake head checks Message-ID: References: <20260227194302.274384-1-kas@kernel.org> <20260227194302.274384-14-kas@kernel.org> <20261027110028.GH2668564@noisy.programming.kicks-ass.net> 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: On Tue, Oct 27, 2026 at 01:05:58PM +0100, David Hildenbrand (Arm) wrote: > > Writing this, I just realized that we have another option -- map the > > shared tail page writable. A failing LOCK CMPXCHG writes back the value > > it read, and the get never changes a zero refcount, so the race becomes > > harmless. The cost is the protection: the page is shared by every > > hugetlb folio of that order in the zone, so a stray write to any tail > > silently corrupts all of them instead of oopsing. > > Right. Without HVO we would just corrupt pages in the single folio (which is > also not nice). > > I'm also questioning whether we need this RO protection all the time active. What do you have in mind? RO only under a debug option, or switching the tail page to RO some time after the remap? If it is the delay, a grace period alone does not close the race. We would need rcu_read_lock() back around the get, and then it is the old scheme with the wait taken off the allocation path. -- Kiryl Shutsemau / Kirill A. Shutemov