From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86FC735202A for ; Thu, 18 Jun 2026 11:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781783313; cv=none; b=BnqcaTfrwN1Euu9ak+gN9pGABNaB45/D8DkTJH99eQ0ASJA8VANBMXvTEBkb+Lql7Htle3rWCI2iKE7Vmg+gNdZ/91FH5i+ZpWu/IScAgq5PK9aa1ZJfD+ltP/erpPth17s3XwZ1OuYaH8OEQZlLhScW8+zsYd7HgT+8pMP4Xps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781783313; c=relaxed/simple; bh=EzJKnR6ULKqUpg1VuqPFnQCGzrtd5JNPD3GndNPz5A8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=liDL1DGhAkXiK74a6lqqWirbs9AQW8ca23waxo3/W25HJBPPQPimvs3LXoQWlivOKCXwymXyKU/4ASbtTzr8wlX66vKbiwaKAQ9Tq5L5R43fUlCUb2fl7+qE66MC+zJThHI0n0LckE7RFgA8i1ZJl4Xxs9WVfoYvCQMUL8FKEXg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=oe+hGl1z; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oe+hGl1z" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-37c5bd8507cso76834a91.1 for ; Thu, 18 Jun 2026 04:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781783312; x=1782388112; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Cv879vejZmMUoFEF8EqJXVB2DS4FZf0fq3v1r5btMdY=; b=oe+hGl1z0VDI125QQf0vr5DAXfConhU/b+dwkV2E9ZYK4JCa8IWAzytKOUrNihwEwY +yrAMDLrq5u8IXlb3Ov8Z4Dxtl2Kgttsyf7ZsC1ihLR8FFWUm/xK3X5EHQ/lHUGearJu HayPjSL94F3jZK0nViE3YuOgXAaJTXD/bCweZ1xF5lo1MSarGz0ahlQi7MiyxMgzVUx1 dkTZwnaIpIVXPronem5SPOusVWVHb9uSDrJQb0SI4uIJcIXh6vcW2SPSsrrwtZq/KsQk qaeK4QkurofTWaNz3sEizBs/H4MSAcBths1ZHTpeggt9iO4rOhS0IsBClIpuLPkXbSvu wyAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781783312; x=1782388112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Cv879vejZmMUoFEF8EqJXVB2DS4FZf0fq3v1r5btMdY=; b=hehNh/DAVFc5zr1f3rtkWPqAAaURNRlHv3xDH69e/OQSbyPhm+Rt6CC80KC98TyKPL qqwg7xQbSigLhp2DHIJiOsqA+mE4t5b2Dy2CGYsbTGPB4aF2k3kIOCfHIsmBE719ok/8 OSa4oPQuge/OGool/6GYtPVj526v0dbHzDvxRNfFh+d7DY7L+V7ZixtLH37C3/Ne3MYk BP+SGta+jWzzZsGujkqX/PN5Vtz3KJSI3BVSH5MKH+6b21sFX8Lq64wRPRkLr70Tbt/6 I5zgirDFsmoN6NjdGjYeKRlDZWvFvZLmx8vAZtRtmA/NWNHxh6+4TqzXvlQzpdGEbUsZ qlIg== X-Forwarded-Encrypted: i=1; AFNElJ+zq/Qu0lynIUkR3MaI1j9j4Y/DcyoGcIRmnWRKYsJEHaxZkxwgS7+mdj3jHFRPmQqw5ACFobCz7QvEob4=@vger.kernel.org X-Gm-Message-State: AOJu0YyFq1PKYS2Oh3pBIg5WlVMfKhxbODIcB7fFvLQZYuodtc6s3+GE LaqIV3w3Z9NKCsoGWWFD1yoNMWF1mGK4LT9gMZAruIr3RkTg4T+CkNxF X-Gm-Gg: AfdE7cm3LaW+aeuT5VkKZkbIEOHDUV/Wyqv1xCZy8OEuVihyWxepaTiGaQa+TPPOUrV uiDRFO+AZaW39g/xLfEgV4YhjfE1wyqgo0eloogNv3Jaq69f+q3Mtur0qN/FOjEIjvqxZ+nQ8fa tFJkAA70hd/X9hqbqzN0hyA1Wa43KBGIuehP4td/5r3tVOyws23Z/rb2+WR7n8B9CsCqPn8XYC7 MbZTmG0A3f0vhZw7l9jsBFwR1hVb0cHfemOnl44VIIsoJ+ChSEN06XFTBaxiWaz6h8r0Nk9Z8mA hyRhM5pWEhcViN6lhX7yBWvLMESoxrPsc5XGHba9IKNu9lgNLcRZc3D8vvJshNVCYEMCl2HYUTe N9UUosP+zrfSemWIKCUzyyQEfvBqz0MTmkdTWzYkOwQ4d+MHWCZ/VAIwoeicEYLy/PhEq0n4ndF 7Oc/3yXt4v++09bGJHXfehoqsUajE0AFq8nq9ylPPnYm6CpXG957Rk5r29wZe0hUD4EFfv4EZHl lpUb3UJ5lXAwg== X-Received: by 2002:a17:90b:3850:b0:35f:bf50:b4b6 with SMTP id 98e67ed59e1d1-37c9daa1e81mr4257520a91.1.1781783311747; Thu, 18 Jun 2026 04:48:31 -0700 (PDT) Received: from fedora ([188.253.112.231]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c8661b5ccafsm17408329a12.2.2026.06.18.04.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 04:48:31 -0700 (PDT) From: Xueyuan Chen To: david@kernel.org Cc: xueyuan.chen21@gmail.com, dave.hansen@intel.com, akpm@linux-foundation.org, 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, lance.yang@linux.dev, yang@os.amperecomputing.com, jannh@google.com Subject: Re: [RFC PATCH v2 1/3] mm/huge_memory: make persistent huge zero folio read-only Date: Thu, 18 Jun 2026 19:48:22 +0800 Message-ID: <20260618114822.165413-1-xueyuan.chen21@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: 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=UTF-8 Content-Transfer-Encoding: 8bit On Thu, Jun 18, 2026 at 11:06:41AM +0200, David Hildenbrand (Arm) wrote: Hi, David [...] >>> We're adjusting the directmap, remapping a r/w page to be r/o. I think we should >>> be very clear about which transition we expect+support. >>> >>> Also, I rather hate the "set_memory" naming scheme ... "set_direct_map" is >>> clearer. Anyhow ... >>> >>> Now we are throwing a "arch_make_pages_*" into the mix. >>> >>> Should it really contain the "arch"? >>> Should it really contain the "make" ? >>> >>> Why can't we just reuse set_memory_ro and pass address+nr_pages? (highmem check? >>> Could that be moved in there?) >>> >>> Or do we want a "change_direct_map_ro()" / "remap_direct_map_ro" interface? >>> >>> >> >> How about naming it int set_direct_map_ro(struct page *page, unsigned nr)? > >To distinguish it from "set_memory*" cruft, maybe best to use "remap" or >"adjust" instead. > OK, how about `remap_direct_map_ro`? If no objections, I will add this API to `set_memory.h` in the next version. Thanks, Xueyuan