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 CD3B0C27C78 for ; Tue, 11 Jun 2024 18:54:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 615EC6B0095; Tue, 11 Jun 2024 14:54:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C5F16B00BF; Tue, 11 Jun 2024 14:54:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 419916B00A9; Tue, 11 Jun 2024 14:54:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1D17B6B00C4 for ; Tue, 11 Jun 2024 14:54:39 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C6AB11405C8 for ; Tue, 11 Jun 2024 18:54:38 +0000 (UTC) X-FDA: 82219509036.12.53BF10A Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) by imf04.hostedemail.com (Postfix) with ESMTP id 90FDD40011 for ; Tue, 11 Jun 2024 18:54:35 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=rNZ1jR4r; spf=pass (imf04.hostedemail.com: domain of oliver.upton@linux.dev designates 91.218.175.178 as permitted sender) smtp.mailfrom=oliver.upton@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718132076; a=rsa-sha256; cv=none; b=KeZx7vAXCrC6aQ27jb1x93bviV49pOa0Eaz7WYT9qbBroWvX4RUw+MtFun/0k1rxYjIAIl 13W9h5B5VBV7szKl19NoRx2HEoh2vlVU37RFaWH8BKv2Pn1sH5KwHYoL95nAvciAI7m8ir w8JOo/qImtaAoqwW8j5v2PwP6r3iPqI= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=rNZ1jR4r; spf=pass (imf04.hostedemail.com: domain of oliver.upton@linux.dev designates 91.218.175.178 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=1718132076; 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=sc7vGujBfoeLmarVWsaWP93Z9rp98KxdQV4sFkCcor0=; b=jwtsM2oBSvg/yC6MIxzJJhLsRK8fhs9LUdgy5ODedVOls6WEBaTW6P56P7VJAk6+4jBmE9 L12FQQ80yaD8l1yE5DSKqh+S8nGZ/glpJ1Kt3cLfteIET/WMKgsfH00sybZNS10Om1bA80 aFtaOa3RW+253XIR2O6fhW2RRgVtRTY= X-Envelope-To: jthoughton@google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718132072; 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=sc7vGujBfoeLmarVWsaWP93Z9rp98KxdQV4sFkCcor0=; b=rNZ1jR4rEN0E4jI4vUUQxETpZp9Uig3k3A0PkgW+xpMdphexak2jtxpcEOcHLVrwBir0ic DpUXt07tN4gIAPyrbhW2yzMNtQehGfYALren39gaCn+hy0zE6pjQfjx0BaWFZMNnlI3o1Q rJzk8GAmhxYpasEqj08hdUI9sVzFf/k= 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: seanjc@google.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: Tue, 11 Jun 2024 11:54:24 -0700 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: James Houghton Cc: 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 , Sean Christopherson , 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Stat-Signature: h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OBDHZ I1LarRpk8etwXmvEzU1fzGJcaRLo5yOiClvFZ4SYP+k8SpACU+gWX0TAsBB2hFzgg16gprc4NOVPUaFiTvOMljNmUFRiqZOLFjuYOr06c0NIydJl4LYpfdk/15J4viZVCGsYcyFfMw0OTk0O5CAMvf/lEOqFWt5BBdYgIAcRRmZMYZUK+K7/DlL3TeFqgkVCkEBfC 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 Tue, Jun 11, 2024 at 09:49:59AM -0700, James Houghton wrote: > On Mon, Jun 10, 2024 at 10:34 PM Yu Zhao wrote: > > > > On Mon, Jun 10, 2024 at 6:22 PM James Houghton wrote: > > > > > > This new notifier is for multi-gen LRU specifically > > > > Let me call it out before others do: we can't be this self-serving. Establishing motivation for a change is always a good idea. The wording could be a bit crisper, but the connection between the new MMU notifier and MGLRU is valuable. I do not view the wording of the changeset as excluding other users of the 'fast' notifier. > 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. > Instead of the bitmap like you had, I imagine we'll have some kind of > flags argument that has bits like MMU_NOTIFIER_YOUNG_CLEAR, > MMU_NOTIFIER_YOUNG_FAST_ONLY, and other ones as they come up. Does > that sound ok? > > Do idle page tracking and DAMON need this new "fast-only" notifier? Or > do they benefit from a generic API in other ways? Sorry if I missed > this from some other mail. Let's also keep in mind we aren't establishing an ABI here. If we have direct line of sight (i.e. patches) on how to leverage the new MMU notifier for DAMON and idle page tracking then great, let's try and build something that satisfies all users. Otherwise, it isn't that big of a deal if the interface needs to change slightly when someone decides to leverage the MMU notifier for something else. > I've got feedback saying that tying the definition of "fast" to MGLRU > specifically is helpful. So instead of MMU_NOTIFIER_YOUNG_FAST_ONLY, > maybe MMU_NOTIFIER_YOUNG_LRU_GEN_FAST to mean "do fast-for-MGLRU > notifier". It sounds like you'd prefer the more generic one. > > Thanks for the feedback -- I don't want to keep this series lingering > on the list, so I'll try and get newer versions out sooner rather than > later. Let's make sure we get alignment on this before you proceed, I don't get the sense that we're getting to a common understanding of where to go with this. -- Thanks, Oliver