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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0284AC27C75 for ; Thu, 13 Jun 2024 06:53:21 +0000 (UTC) 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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Pob+bbjOFf7h6fV5Z73fEIqJzbiI/6j+uQH9c0cAzHg=; b=i9LGMQov0IBiDjjc0YqKrkbhlW BAByTe9Oa+jDREHxGF7BV9LwEDusduNolGifu1f5hKMpx6QXanDV5T98QPWt4OIQX8TwE3c/5uU1y rnM4s4INo2NyQP6Ax7ZhIR0gyTK+Er16no16wUpPrFGOgjV7Zjn3PhalrD9BECEIqYtp7Nz0y4bhg si51rlf6nJJQbi/iEOlhCZjS+QqY8fLTP6MVqFURA1t/K4+tMvbaB5afXtYf06AZFH607UpPFZh6G /sAaWbUJ2zu7Uf2C/EkcaCwr2z3UaWAfbaMUKvThb4fNF3D9ipmczwzXjTlPsrPZp4THwfcIV9FLe e2+wogBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHeKb-0000000FNbJ-3nsS; Thu, 13 Jun 2024 06:53:09 +0000 Received: from out-188.mta1.migadu.com ([2001:41d0:203:375::bc]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHeKZ-0000000FNZv-02CD for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2024 06:53:08 +0000 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240612_235307_214723_79A667BB X-CRM114-Status: GOOD ( 19.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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