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 B043E606A324 for ; Tue, 3 Nov 2026 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=i6RmvnlD; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fSwwEMS8 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-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=13JW4Jg1dgguEj52L1u0IsGyjIw3tDUJ2h7ClviJyY8=; b=i6RmvnlDGhfqThdU1Kg38X+4YD lV/371XAvRnVrKkQ+CwSyteEBQUGrUiIcMiKYkiQxXJ90tcU+xk4xc9s+EcREx5/x617TML+sTjne mXuzLowtJWEDkzxlHLLl0/rJOLfF6ss/1iNM1QmcTU4CqM36Z3rJADG7zOfbphHBTw9jZvGT8Z1Zn QZpJMl+Em9HMIidFpFWKvhrcnIBw0ttS6M4KmMtPId0F3b6cb7B3FG25mnPXeklJyyrW/keYCogPr /5CF5I8+uO0wfaqxuYyf0cYloimMn3bXJS4hmECHJyLRn+DqNt/k39CAtWbqDTOULDs5oosx6dXn+ 1Bq/zEdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xO9nA-00000001Wl3-3xd2; Tue, 03 Nov 2026 08:22:52 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xO9n9-00000001Wkd-2fOF for linux-arm-kernel@lists.infradead.org; Tue, 03 Nov 2026 08:22:51 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id B5070600CB; Tue, 3 Nov 2026 08:22:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 634931F00919; Tue, 3 Nov 2026 08:22:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793694170; bh=13JW4Jg1dgguEj52L1u0IsGyjIw3tDUJ2h7ClviJyY8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=fSwwEMS8pmYxYNewqxpreRAZUTtGEezumjUaaQfeWPeliuCX1y4K4Lvv7BUhRO27R Nn8UgjSY/gr417JvHxxnjQS9+CoEsWXO/IhyZvx0iZXjawwMgS2UjUEzkHKkdIpL0u orG1VzSyyVj+SZUUH0Bc4kWTQh24Ap7Nhbwrlf38lDXfFxmzDtE+EURHCEm55pCTzv c5FYXuyMk6c7juSyVfc8UJBtUruPoHsXOwI+vGe2seSZJrtl3PFt75aVux4fpIE7sE PICibbKPcNRBYX/3y5EzN1GpbTRKHXVmTg2CDQu0Bbp8M+kmUfBc31TYYMfJJTQh2u G0a7j2yo/+YRg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xO9n6-0000000AKdK-0bgT; Tue, 03 Nov 2026 08:22:48 +0000 Date: Tue, 03 Nov 2026 08:22:47 +0000 Message-ID: <867biu2ujs.wl-maz@kernel.org> From: Marc Zyngier To: Vincent Donnefort Cc: oupton@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, kernel-team@android.com, fuad.tabba@linux.dev, ljs@kernel.org, ryan.roberts@arm.com Subject: Re: [PATCH v1] KVM: arm64: Fast path transparent_hugepage_adjust() for non-PMD folios In-Reply-To: <20261102211900.504192-1-vdonnefort@google.com> References: <20261102211900.504192-1-vdonnefort@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Archived-By: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: vdonnefort@google.com, oupton@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, kernel-team@android.com, fuad.tabba@linux.dev, ljs@kernel.org, ryan.roberts@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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=-5.9 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 autolearn=no 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 On Mon, 02 Nov 2026 21:19:00 +0000, Vincent Donnefort wrote: > > transparent_hugepage_adjust() must walk the userspace stage-1 to detect > if a PMD-level mapping is installed. If it is, then a stage-2 block > mapping can be installed. Even though this stage-1 walk is most likely > cache hot (in most cases, the mapping has just been installed), walking > a page-table is still costly. This walks accounts for ~5% of the > user_mem_abort() execution time on an Apple M2 big core. This makes a > fast path interesting. This raises a few questions: - Isn't this a "fast fail" rather than a fast path? You don't make the S1 walk faster, but you instead avoid cases where it would have returned an level-3 size. If anything, you make transparent_hugepage_adjust() slower for the case that succeeds. I don't think this invalidates the approach, but it feels that the commit message is just wrong. - How do you measure this? 5% feels like a huge amount for something that should be 3 loads. Isn't this more an indication that the page table walker is overly complicated because it was designed for something else? In any case, It'd be good to verify your findings, so please provide a minimal reproducer. Thanks, M. -- Without deviation from the norm, progress is not possible.