From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58040C4345F for ; Fri, 19 Apr 2024 22:23:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD2136B0083; Fri, 19 Apr 2024 18:23:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A815B6B0085; Fri, 19 Apr 2024 18:23:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96FA56B0087; Fri, 19 Apr 2024 18:23:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 799C86B0083 for ; Fri, 19 Apr 2024 18:23:57 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D5006A0794 for ; Fri, 19 Apr 2024 22:23:56 +0000 (UTC) X-FDA: 82027710072.09.4413C1F Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) by imf01.hostedemail.com (Postfix) with ESMTP id EA24840012 for ; Fri, 19 Apr 2024 22:23:54 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=P8isnNkf; spf=pass (imf01.hostedemail.com: domain of oliver.upton@linux.dev designates 95.215.58.176 as permitted sender) smtp.mailfrom=oliver.upton@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713565435; h=from:from:sender: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:dkim-signature; bh=mthBWOOhcNSWoMZhMTAfzR7XGep2Qks53Rpg12wvEhs=; b=G9/wCquvH7kFYRlwaYLji70pFy1tBd9sSgJk3Rtduf0ro+5gB4togy1dZarDc5rpK9d7Vx wrLyUh14BpYxeiic2AxpCiW+/xSrkEtox359DDTf/gpGxIzQJ5K0fzs7e5Qu8UBXZ2RCVj 7ZjTugVisW+3JfB5vHWQ0CNmooL2afA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713565435; a=rsa-sha256; cv=none; b=xhoM9YXf0MXZfUVk114FMOb3TX/PRlxbODNOs6CoYD4VJuDQm1htjXojpvwx49CiblWEpg 0keuMWkVVX3B+Kl8qpX9QYDze8KvPxmFk//I5D0lXAnNddEC1sCg0MK4UitkDx0kkL/jx6 jFfTGPDw12BfUc5tg2w8E+J3bTy3l3o= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=P8isnNkf; spf=pass (imf01.hostedemail.com: domain of oliver.upton@linux.dev designates 95.215.58.176 as permitted sender) smtp.mailfrom=oliver.upton@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Fri, 19 Apr 2024 22:23:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713565432; 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=mthBWOOhcNSWoMZhMTAfzR7XGep2Qks53Rpg12wvEhs=; b=P8isnNkfBYXWB0pGZ4e76KozKbuIPo6rHG7Ox+d9b31tlskAlwzX5Fiy922x3848sQHdds 2boqaE4bF1mMbPeod2X267+67KV2A02qKBDa6v3fbd7lZbgPblznjJvZe8hzyomSxDd6nH 88u9gjkSLzKAR6O3WgIDpbW6x4ZMNao= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: James Houghton Cc: David Matlack , Andrew Morton , Paolo Bonzini , Yu Zhao , Marc Zyngier , Sean Christopherson , Jonathan Corbet , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Shaoqin Huang , Gavin Shan , Ricardo Koller , Raghavendra Rao Ananta , Ryan Roberts , David Rientjes , Axel Rasmussen , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/7] mm/kvm: Improve parallelism for access bit harvesting Message-ID: References: <20240401232946.1837665-1-jthoughton@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: EA24840012 X-Stat-Signature: 4u1kikdis144qn8hc7mdmywini9wgprk X-HE-Tag: 1713565434-231071 X-HE-Meta: U2FsdGVkX18NG5YFU9TlXtckcOw1vuPnqJHDCc1dYnpx6Fkx4bMe0CMuYjYfp9fzMfjnYPocPPsY4mRPe4sWKoKkMMUX3PjsDXHJqrQyYEQWdKeJOYqQ9GjI7ifcS0iqvqmkVMdimZCI1U6BnqJJgCniaCLbwnMrR0o8l5ddsyySqMPxYXalW9O0/lcsriB+llXUdR4O55eeM1+qTc8yzTyxVkaAqmk/7/dp7/o/+asTqGRiT/6BI1XSYBITXV4VzQXUw4qXBqUWMCpfmlhO5wKZqJ2QTkHJBigD867DYSdVIu+Zht7KcI9bjc5llnqtyK3nWg+DxB42u7yfUYc8cYKqhFdfdDEzAjBWFS2NYy9i0MF3uYZYyccfpozVLIFmmDakv0qNSqV+kxxedDEn+TjEKhHYhM00gUMP1mNx2KADqtxhQdxt0NEEDw0y9U+iMoNxoAdZx/w2zdtE3aNhIZCaMq6bAPUU+DV6lVlcTKnSie8QpbrrAGzj93R7LtNHKdj5u0u+LAxC8F/R4w2avv0weG/b2T236zkWMVMf3aYV0RtT7Ku5oKhpxiR3rn6PVOOqzsG6WOiRV6HuIcUwHTmt4RTmKyO0pPB1OtxDkxlqI6pFwOOasF1BSglTdTYYIomnPBa1SEUOXxSwk5p20jqEJmX25XqhfHsAzEiyaBES4qULYWPXugC1khl3Nvsu1QmdK1MyohqA1M61okZcipjAYW0BRUs5OigHbRYIT7V5/KpQcvQhM+n82wvimendgUFaEz/C+6VB3PAzXUCrQzWukcsMiKZKiu1lzzzKr9dXUpk0j9RLkA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Apr 19, 2024 at 01:57:03PM -0700, James Houghton wrote: > On Fri, Apr 12, 2024 at 11:41 AM David Matlack wrote: > > > > On 2024-04-01 11:29 PM, James Houghton wrote: > > > This patchset adds a fast path in KVM to test and clear access bits on > > > sptes without taking the mmu_lock. It also adds support for using a > > > bitmap to (1) test the access bits for many sptes in a single call to > > > mmu_notifier_test_young, and to (2) clear the access bits for many ptes > > > in a single call to mmu_notifier_clear_young. > > > > How much improvement would we get if we _just_ made test/clear_young > > lockless on x86 and hold the read-lock on arm64? And then how much > > benefit does the bitmap look-around add on top of that? Thanks David for providing the suggestion. > I don't have these results right now. For the next version I will (1) > separate the series into the locking change and the bitmap change, and > I will (2) have performance data for each change separately. It is > conceivable that the bitmap change should just be considered as a > completely separate patchset. That'd be great. Having the performance numbers will make it even more compelling, but I'd be tempted to go for the lock improvement just because it doesn't add any new complexity and leverages existing patterns in the architectures that people seem to want improvements for. The bitmap interface, OTOH, is rather complex. At least the current implementation breaks some of the isolation we have between the MMU code and the page table walker library on arm64, which I'm not ecstatic about. It _could_ be justified by a massive performance uplift over locking, but it'd have to be a sizable win. -- Thanks, Oliver