From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 49D383FADE8 for ; Thu, 11 Jun 2026 12:51:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781182296; cv=none; b=ms+Y9d71jH9itRJoEXme/URiypZSG4GMqvWSGIPDdZukE2xalJBhX9MWZxNIqspMQmUfvrsxpDvtdB1KYOBA8s1pXTTLLFBsvp11E3wKayq5p70IfcniXSSTWFNWGBoE6QSd5oI2voaxZpcESRSpgRHsf1uOp0NvPJt++AHntuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781182296; c=relaxed/simple; bh=jr/w7d5+N4KTKfMIOpHfL15u0NRU2ufNyQGGbQYU1YE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TcIeGebAMsJOxmwDN3s8X1RBVI1OlmqdH4RKO3YVpfslRwzU3JWQV8UP8INOSnlHJbSV+8C7uztIrjFvL/CN8XGhXd+Tki8i79wCfeeCOmFlOPKmrU9D9jk5iOcmfaFmDgqeWz9Xs9skKUqZU03cYMpL5xEjE2B8bWF5sEEYXJ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=eesZ0NDn; arc=none smtp.client-ip=95.215.58.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="eesZ0NDn" Message-ID: <1a547b9b-dd6a-40fb-8669-3bb307eb05e2@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781182291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9S9SdGtbm1JyTfljX6WLjQs95rf1oKktzDq3rIIBuu0=; b=eesZ0NDn4arZq1eS4Me+sKBxmY7/1zh2Xohy+gcqQwOvoaQoEOYaxTNVbuV3UrqYxOYMgS +wiEuiiDOgD4QpWz/uuqRw3jEL3Lso9r4Qc9VpX9LdZmf0E7EYh7LcKERuNt/hVveKmu5R QXn3GY34ZpXtYuPfbBLNl5hnkucIye0= Date: Thu, 11 Jun 2026 20:50:04 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RFC PATCH v2 1/3] mm/huge_memory: make persistent huge zero folio read-only Content-Language: en-US To: "David Hildenbrand (Arm)" Cc: akpm@linux-foundation.org, xueyuan.chen21@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, hpa@zytor.com, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, yang@os.amperecomputing.com, jannh@google.com, dave.hansen@intel.com References: <8c36a91d-288f-4ffb-b2ec-41e3ef789d72@kernel.org> <20260611115817.59353-1-lance.yang@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/6/11 20:21, David Hildenbrand (Arm) wrote: > On 6/11/26 13:58, Lance Yang wrote: >> >> On Thu, Jun 11, 2026 at 01:28:58PM +0200, David Hildenbrand (Arm) wrote: >>> On 6/10/26 04:15, Lance Yang wrote: >>>> >>>> >>>> Right, this came from the RFC v1 discussion[1]. David preferred a page- >>>> range helper for possible future non-folio callers, not something folio- >>>> only. >>>> >>>> Of course, we could also add a folio wrapper on top of that if needed :) >>> >>> Best to document that as part of the patch description: we don't really expect >>> to have a lot of read-only folios in the near future (zero page is rather >>> special; maybe it won't even be a folio in the future). >> >> Ah, good to know, thanks. Will spell that out in RFC v3. >> >> Maybe something like this? >> >> The huge zero page is pretty special case, and maybe it won't even be a >> folio in the future. Since read-only folios are unlikely to become a >> common thing, a page-range helper is the cleaner fit. > > Right. And if read-only folios in FSes become a real thing, we can always add > infrastructure for that. Got it, that draws the line nicely :P