From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A6FB606A322 for ; Fri, 4 Dec 2026 03:46:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=dVTrAy/a; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=B2TOHi6L DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=bN3tenzIceispf5XdDPsIopJ7BXCQZFoVNLY/e5NinQ=; b=dVTrAy/aUvs2/T wM3wq+z38T5q//kigIsVAHjqBBAv8a4pUxJreIiNjapwOQ5jBS5JFrwQbJQzN0HlqZ+EMLkWWOCgm w9yVof7ETway42y4BgTfO7us4XXwmwgk9KiOJC9ale9DyYdMzc6di/TOB64O2wkbTCNyctbcO4LLf Lh7QOeREHe9pIUSzX+oIaUw03s17e939T2g6vH95tskdV5FSGDQHlVN+ejDG1/FAPOBwJB7LF8nbm vLUIUlzO9uIIyziLxuCLPbsErqXAhgkeUv31TKkDMYx75SmtUFMiIWATspFE2IJZ/fjpSi4FeYtHS eaaIrGNMUmX2rqpEHHRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZKF7-0000000GYeB-0rbt; Fri, 04 Dec 2026 03:45:53 +0000 Received: from out30-97.freemail.mail.aliyun.com ([115.124.30.97]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZKF2-0000000GYcp-1VjR for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 03:45:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796355937; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=bN3tenzIceispf5XdDPsIopJ7BXCQZFoVNLY/e5NinQ=; b=B2TOHi6LQh2Gpe+zJdIJZDhNUEjpeDstDD9Kvw7+H2m+3c0EOF7RPBWQs6aE6JjtRV3+z8n5sIVKwqVQnjntL9GP70Pag4bh28DCkLcVVJ4tFf8k4jjp6lxuNWx756zprZXySczmQqlQRvlQeCtv6bFHzYsKNcNxrDLv44Y6ktQ= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037026112;MF=jiangtianfeng@linux.alibaba.com;NM=1;PH=DS;RN=42;SR=0;TI=SMTPD_---0XGFrhlE_1796355925; Received: from h68d07384.sqa.eu95.tbsite.net(mailfrom:jiangtianfeng@linux.alibaba.com fp:SMTPD_---0XGFrhlE_1796355925 cluster:ay36) by smtp.aliyun-inc.com; Fri, 04 Dec 2026 11:45:34 +0800 From: Jiangtian Feng To: shivankg@amd.com Cc: Jiangtian Feng , akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, bp@alien8.de, ankur.a.arora@oracle.com, dave.hansen@linux.intel.com, tglx@kernel.org, bharata@amd.com, hsalunke@amd.com, mingo@redhat.com, hpa@zytor.com, david.laight.linux@gmail.com, rientjes@google.com, torvalds@linuxfoundation.org, tejavojjala@google.com, nhuhuan@google.com, pfalcato@suse.de, peterz@infradead.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, nico.pache@linux.dev, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, usama.arif@linux.dev, kas@kernel.org, ying.huang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, tianruidong@linux.alibaba.com Subject: Re: [PATCH v4 1/6] mm/highmem: introduce copy_mc_can_batch() and __copy_mc_pages() Date: Fri, 4 Dec 2026 11:45:22 +0800 Message-ID: <20261204034522.302814-1-jiangtianfeng@linux.alibaba.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261201-batpagecopy-v4-1-dd82a573e573@amd.com> References: <20261201-batpagecopy-v4-1-dd82a573e573@amd.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_194551_268945_8CC2215A X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -17.6 (-----------------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Shivank, > Add copy_mc_can_batch(), which tells whether a page range can be copied > with a single copy_mc_to_kernel() call, and __copy_mc_pages(), which > does that copy. There is a pending interaction with the arm64 copy_mc work. I am preparing a respin of Ruidong's v15 series: https://lore.kernel.org/all/20260618092124.3901230-1-tianruidong@linux.alibaba.com/ The respin selects ARCH_HAS_COPY_MC when ACPI_APEI_SEA is enabled and provides architecture-specific copy_mc_highpage() and copy_mc_user_highpage() helpers. Consequently, ARCH_HAS_COPY_MC would also enable this raw-range fast path on preemptible arm64 kernels. Your range wrappers handle KMSAN metadata, but the arm64 helpers have additional semantics. When enabled, they reset the destination KASAN hardware tag and copy MTE tags and their page/folio state. The user variant also maintains the dcache-clean state needed for later icache/dcache synchronization. They queue the actual source page when either the data or MTE-tag copy fails; the latter failure has no copy_mc_to_kernel() residual from which to derive a PFN. The raw fast path would bypass these operations. Could we separate raw-range batching from ARCH_HAS_COPY_MC with an explicit opt-in, for example ARCH_HAS_COPY_MC_BATCH? The Kconfig help should state that selecting it requires the architecture's per-page helpers to have no additional semantics beyond the raw copy, KMSAN metadata and residual-based source-page queueing. That description is only about raw-range equivalence; the ordinary copy_mc_to_kernel() contract remains unchanged. copy_mc_can_batch() would then check ARCH_HAS_COPY_MC_BATCH instead of ARCH_HAS_COPY_MC. x86-64 and ppc64 can select the new symbol alongside ARCH_HAS_COPY_MC, preserving the fast path covered by this series. Other architectures retain your range helpers and caller conversions, but take their existing per-page fallback. No arm64 exclusion is needed for raw batching. The range-order change and its failure-order effects remain a separate review item; this opt-in only prevents bypassing the architecture helpers. This seems preferable to making arm64 disable PREEMPTION or dropping the generic range work, and leaves room for a future arm64 range helper that handles its tag/cache/failure semantics explicitly. x86-64 and ppc64 would retain responsibility for validating their respective raw fast paths; arm64 would validate the per-page fallback. Would that split work for v5? I think the selector and the x86/ppc selections belong in this series, so that adding a new ARCH_HAS_COPY_MC architecture cannot silently opt into raw batching. If you prefer a different ownership or ordering for the prerequisite, please let me know so we do not post competing versions. Thanks, Jiangtian