Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp204352lqq; Wed, 12 Jun 2024 23:53:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVCuEUSTCrNu47mqMDEgmmvr3Q/5SSKbG+ClwDiKfnBge3dpz+7ZaJNKx77eTJpzc9kLQs3+fMNskpJGM6LSBgnrAIS+Oz/0CtIQvLJVA== X-Google-Smtp-Source: AGHT+IEOCvMwM2MSYiM5a6+82fxUUlZ0dTTgKgWeVR12zOXlKmooUJ/x+l+Bkoqizy4gsrbJblKU X-Received: by 2002:a17:903:189:b0:1f7:8a9:91c8 with SMTP id d9443c01a7336-1f83b7024e7mr40500815ad.39.1718261620256; Wed, 12 Jun 2024 23:53:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718261620; cv=pass; d=google.com; s=arc-20160816; b=Z6rbGw6Aa/H8vyzCLVcvS20IJUImPEn86PT3i8TL0gu7k0Zj/KfnsaIn5mKNm3eLG0 s8bWvKd9KQz30Zrr8Rfg0ycR6a8bIg69nSQYLJOb6teeXMnju+s+FUPYq9+mAFZas6nY oZNBIEQqoM0v5CCfi3EzMjtVgQsM7vJzTWJijZJBAitVRoJfv24EU3j1lWQgdEpy41G3 8/lqVsWa+nMFppMjrOCxKtSOu3CJNxhHRyFhY8Sz9qoGOyCcODc13nIyDsHhz7o/kjpe yFM+cAEIGIEVadGDj7SZF2lheCH9t1rRlRHMeduM01pD6a9nXioBquqen9xnpmqPoVsz l+ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Pob+bbjOFf7h6fV5Z73fEIqJzbiI/6j+uQH9c0cAzHg=; fh=S4XIDSJHz4tt3s4uZN93MUX/r2+LA80lKGFYTizORSQ=; b=YdKEmnv4fHRxdvIQIHckHqRPJu69E867R9voFiSiZNozTzXw5miFIcgl6Vpht5+843 Kl2W5+wtrixpzHAfISypxp7xnx4vN8kxAPLYdMIUyYxp+MHupNy6AlCtw3NZLHeRRg6f 8bzd8E77+zbRZv6ivntB72hViVk9e1JeNofLxGGURtAv7680ThqZNtNLidzfXoPaUHTh 6e59St5UwolJTtAZh2KCM8NTh7ue9imSxQsIeiFErbXtYI9Nw9hZ7Sr2PzrBSa3usZVr 2pNfJRrsyCG2+eb9CRh8GCrJajUz2l9rdRLW6D5aiYJ0j1r7SZBu8nZ31xg3x/aG68Nd 3iQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=E2YkpHhg; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-212658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212658-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f855f1845dsi6968715ad.570.2024.06.12.23.53.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 23:53:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=E2YkpHhg; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-212658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212658-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4219E28564A for ; Thu, 13 Jun 2024 06:53:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE6A9137C31; Thu, 13 Jun 2024 06:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="E2YkpHhg" Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 8740B130485 for ; Thu, 13 Jun 2024 06:53:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718261587; cv=none; b=X4l6qr2lHM540i/Dn9yvOy+hboJlLps2HWmcCUQ9FbJGebCH2HgocEl4MaKKJ+7qAlwtrsFjD3Wu8jgAo4zfyf1LjMNNDv6fUyOtGTUc/i7xFt2yOlCgeIdASKZ7A2Vz22MZRTQOREWiLfrbNMqpkWLiTreVC2aUPBAY2IZECpc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718261587; c=relaxed/simple; bh=yraTjogu4eOqUCyxiyu0hsjap40zvHzUuM2vZuXA884=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WJNzgncF69zfIZ/5Qp9IFUCSqXWkJiO1vS8xo3Ab0z9PRXtIUuXEZoQUPK8QHp4l2Wq8HMuJ+GB6zsSQ4rFHeb1HEx2P/kpOpfoBOBYdT6qSJlYR2zltGOH5EjURI4XTEJys3nRZoeuMUgGupp2PKXRJLeLHWUxrpUaX9IH1Umg= 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=E2YkpHhg; arc=none smtp.client-ip=95.215.58.188 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 X-Envelope-To: seanjc@google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718261582; 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: in-reply-to:in-reply-to:references:references; bh=Pob+bbjOFf7h6fV5Z73fEIqJzbiI/6j+uQH9c0cAzHg=; b=E2YkpHhg9Fmt6ybwKMqAQ8YYVGNLeh+hnNDYUUgtnxXsZt8FPeY8y4asORfx9UtpBGDdgW f89IxPl8BPGmssOaYtFNoF4Ne/Nort9q7LMc+MCYF/csuZLtAUXsUTYi9NWg2lq3NtdWXS n7jRAHCQzaqnHvPxkt9oahMQUtNWoPk= X-Envelope-To: jthoughton@google.com X-Envelope-To: yuzhao@google.com X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: pbonzini@redhat.com X-Envelope-To: ankita@nvidia.com X-Envelope-To: axelrasmussen@google.com X-Envelope-To: catalin.marinas@arm.com X-Envelope-To: dmatlack@google.com X-Envelope-To: rientjes@google.com X-Envelope-To: james.morse@arm.com X-Envelope-To: corbet@lwn.net X-Envelope-To: maz@kernel.org X-Envelope-To: rananta@google.com X-Envelope-To: ryan.roberts@arm.com X-Envelope-To: shahuang@redhat.com X-Envelope-To: suzuki.poulose@arm.com X-Envelope-To: weixugc@google.com X-Envelope-To: will@kernel.org X-Envelope-To: yuzenghui@huawei.com X-Envelope-To: kvmarm@lists.linux.dev X-Envelope-To: kvm@vger.kernel.org X-Envelope-To: linux-arm-kernel@lists.infradead.org X-Envelope-To: linux-doc@vger.kernel.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: linux-mm@kvack.org Date: Wed, 12 Jun 2024 23:52:54 -0700 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sean Christopherson Cc: James Houghton , Yu Zhao , Andrew Morton , Paolo Bonzini , Ankit Agrawal , Axel Rasmussen , Catalin Marinas , David Matlack , David Rientjes , James Morse , Jonathan Corbet , Marc Zyngier , Raghavendra Rao Ananta , Ryan Roberts , Shaoqin Huang , Suzuki K Poulose , Wei Xu , Will Deacon , Zenghui Yu , kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v5 4/9] mm: Add test_clear_young_fast_only MMU notifier Message-ID: References: <20240611002145.2078921-1-jthoughton@google.com> <20240611002145.2078921-5-jthoughton@google.com> 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=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Tue, Jun 11, 2024 at 12:49:49PM -0700, Sean Christopherson wrote: > On Tue, Jun 11, 2024, Oliver Upton wrote: > > On Tue, Jun 11, 2024 at 09:49:59AM -0700, James Houghton wrote: > > > I think consolidating the callbacks is cleanest, like you had it in > > > v2. I really wasn't sure about this change honestly, but it was my > > > attempt to incorporate feedback like this[3] from v4. I'll consolidate > > > the callbacks like you had in v2. > > > > My strong preference is to have the callers expectations of the > > secondary MMU be explicit. Having ->${BLAH}_fast_only() makes this > > abundantly clear both at the callsite and in the implementation. > > Partially agreed. We don't need a dedicated mmu_notifier API to achieve that > for the callsites, e.g. ptep_clear_young_notify() passes fast_only=false, and a > new ptep_clear_young_notify_fast_only() does the obvious. > > On the back end, odds are very good KVM is going to squish the "fast" and "slow" > paths back into a common helper, so IMO having dedicated fast_only() APIs for the > mmu_notifier hooks doesn't add much value in the end. > > I'm not opposed to dedicated hooks, but I after poking around a bit, I suspect > that passing a fast_only flag will end up being less cleaner for all parties. Yeah, I think I'm headed in the same direction after actually reading the MM side of this, heh. -- Thanks, Oliver