Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp34474lqp; Tue, 11 Jun 2024 13:40:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVujEujnMbqyNlTOuJJSFlPnJNHEmAyrbXmLJCkvUkVynDsxZVElIm//jsqUM8dy5YcWFIIHX6jgohx24fD2XEKLiNSCaS/LDB9zWXZ7Q== X-Google-Smtp-Source: AGHT+IGOAH+FiyqSHabgDFnyBm/LQmvOHjWdCAXH9Kwkv10nmngkW3ZzhsPgP8uBOEvPpRjn257S X-Received: by 2002:a05:622a:91:b0:441:2fd0:e090 with SMTP id d75a77b69052e-4412fd0e6e1mr43060551cf.34.1718138402016; Tue, 11 Jun 2024 13:40:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718138402; cv=pass; d=google.com; s=arc-20160816; b=iawv21Ubpms9hLFncpzT5U5AnZKfcPUZbQQ/xamSL5XgQV0zooppvCl5IKTeVgeg6y 9zRT18Tlr7QBDB6/IJz9JcEPy0igshuupcRI738egSNSH+U2is3c73BEjJF5wCQ7uBOu T5woeEva0DLZ9g8ucZESWgDs9t2N1SctPsmGbizICX+KBrvFjgsD5KL4W/8A8L/HBEk/ xjfp7+eNxPMLaC8kUzHO9W4QU94DS3JhJD6sfEEm4AuUqeitUV0PU7G8pUKYtuBm3X+W UAnY1majSr4u5NKOFlda3xetLbH1++cRy08b2ohFTf8fD2b+fKNevRd1ixsUYgOOS99w H3cA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Uwv7P+rpbL3D4lWasBXzA1FdWhb0FlRL25Aj/PT5ky8=; fh=yIcaP5fERO03cqT0bb+HLk9ar+nL3bvftPoQ5h7oCbo=; b=sDg5vo6RG5Oc5UYro7WykiVamTyaq1UJm8dpdSKrddkLJrge0BbLNpeYakpvZUs3/P +YV97fRSF+KFLb9KJ1r99rsxeu388vKHEN2BkJgY27sv0FZKXJlf7XJMSWTmOxd8DZMD oylqLZaXFLg1L3yu0D7Z370R5FIFfaRa+tTe2anVvbo3uj3aQzD4RSDjWah3abzw7eaM W7oAUUcmxu1NBzLQfieP81cqbT5TYSCwZ3EtH6MT/AqM4kp3LHbQRVb1bIMWXOK8Qkjx OefJNJyXkx+zDD4Lp5z7sRDqigBy53ABGLvFOXvZyv0R7b/hYvwnfULkzGixov7hFiju XKkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CXhBu0FG; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-210583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-44056a5db20si85081241cf.529.2024.06.11.13.40.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:40:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CXhBu0FG; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-210583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AD5C21C234E2 for ; Tue, 11 Jun 2024 20:40:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC0211527AC; Tue, 11 Jun 2024 20:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CXhBu0FG" Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B8061514F5 for ; Tue, 11 Jun 2024 20:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718138389; cv=none; b=c3Lr6hVD4h2qEp0LqnAeijHuVX81PkJJkSr0QoN1+hxbzzYFTNLYfUilx+t5JX0su+tWjBAnimAk3PtSn0k59L8Gqnu+Y141JGzomQFNutdqAKruTiWL/e46h3b/6HbnHlhTuF38TCLt+8zVzKup59f/OELL9nZ+R3kDatIPO1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718138389; c=relaxed/simple; bh=Uwv7P+rpbL3D4lWasBXzA1FdWhb0FlRL25Aj/PT5ky8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RVfU/tGl9Bs65nkhaYxGXUxsxhjzmDDtnlGRbnMHG+WcXYCGjwVtF7iwAxN8SFUhjpmUZxViZXE+V1Vv/4eTU6Biiz20H/sJ/w1s9CACXhMkvjS8Wv+jFEKDP84flTjhZhfLEBK4fKpJu5u4akTson5v/rHJ1fnaLbWySWzNSM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=CXhBu0FG; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42175bce556so2305e9.1 for ; Tue, 11 Jun 2024 13:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718138386; x=1718743186; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Uwv7P+rpbL3D4lWasBXzA1FdWhb0FlRL25Aj/PT5ky8=; b=CXhBu0FGXtgkEy11Lid9NMC8XBoNUxYHMTPO6jBo++AeJc0N3ZfzjG5XZA/oSwkTrS 9oKifm8BtLS/DBWdQUhPiZeNED376lnnSrm0JiihIroSRDqw8tbHecBhCtFTT7VmvPRs x953xeSAypdHU5GFF4krzn2U2ZDebziXyX6oFkFdo2wzudqFEMd2XFXQnD7WrV0EFHNT 1QsD2GhtXvlNKXYUeuHq6yuiVigCl/3l9hW/6tOOdAxnx/RmfEOaXaMbmmEuotnVlPZL VinPFecKQxaQF1fQYx0pfzv9UN8A6Zyz/xtJlOyaY8iSK43y1YqX4WQcDH1ogIp7/MLu grtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718138386; x=1718743186; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uwv7P+rpbL3D4lWasBXzA1FdWhb0FlRL25Aj/PT5ky8=; b=IPfnzCl+slXBTR5/rpbFYmGLdzni1jMiouxPnpKojwEYWeSmdrfiZyYLwSGHmuC5cu YGRbSMPdq02a/JKJo9t55GjPja/4DsqhN0ozFQZ2wOXulf4EKZ1sM6RPTFdUeQl2ngMw 5uIjhBNxIm8doAaicQqEgvj7myBFGY2QOLoKcMwrDPJZF94Bk93E8fnbEl1gfwX4lqja S4beFoOzcTgKva4oCdsrZFX9QpfPfomjUROnidBebCx6mwqfuvlLMYZPkdUN7tvbQfrm ctdOxv3cl+Upo1bnaXuaazGrLGuO6cWoxIHlmXxQm5xDrYFNK11bm+jKzWN9pDpbu9m3 FuBQ== X-Forwarded-Encrypted: i=1; AJvYcCWlx72mMVjW/vz1QxqAjlRDvCZwHtBDFRxb22o/HOmuMWQbxH+5ry1NRxKmtyNCZeLppv323OJE1XwzZBDPg5yxY16Cto/FJ5EeD0uy X-Gm-Message-State: AOJu0Yx7Y6P25Jd5EqujTah5BQXSshvx99nk42UrEkONejqZ9OSStQ80 obEsGfo4tFKlp2rNM1JXB8Vo94GshMqcB90TIYlHEAxSymaJ/SIJ9eU/w39aT0sOUs0DFqARYQr tKVpv88+5I0iXSYBb56ck/lmbLoVpL+hrZR3J X-Received: by 2002:a05:600c:3d0a:b0:41a:444b:e1d9 with SMTP id 5b1f17b1804b1-42281b927b6mr453365e9.4.1718138385453; Tue, 11 Jun 2024 13:39:45 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240611002145.2078921-1-jthoughton@google.com> <20240611002145.2078921-5-jthoughton@google.com> In-Reply-To: From: Yu Zhao Date: Tue, 11 Jun 2024 14:39:07 -0600 Message-ID: Subject: Re: [PATCH v5 4/9] mm: Add test_clear_young_fast_only MMU notifier To: James Houghton Cc: Andrew Morton , Paolo Bonzini , Ankit Agrawal , Axel Rasmussen , Catalin Marinas , David Matlack , David Rientjes , James Morse , Jonathan Corbet , Marc Zyngier , Oliver Upton , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 11, 2024 at 10:50=E2=80=AFAM James Houghton wrote: > > On Mon, Jun 10, 2024 at 10:34=E2=80=AFPM Yu Zhao wrot= e: > > > > On Mon, Jun 10, 2024 at 6:22=E2=80=AFPM 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. > > > > > as it wants to be > > > able to get and clear age information from secondary MMUs only if it = can > > > be done "fast". > > > > > > By having this notifier specifically created for MGLRU, what "fast" > > > means comes down to what is "fast" enough to improve MGLRU's ability = to > > > reclaim most of the time. > > > > > > Signed-off-by: James Houghton > > > > If we'd like this to pass other MM reviewers, especially the MMU > > notifier maintainers, we'd need to design a generic API that can > > benefit all the *existing* users: idle page tracking [1], DAMON [2] > > and MGLRU. > > > > Also I personally prefer to extend the existing callbacks by adding > > new parameters, and on top of that, I'd try to consolidate the > > existing callbacks -- it'd be less of a hard sell if my changes result > > in less code, not more. > > > > (v2 did all these, btw.) > > 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. Only if you think updating the MMU notifier API is overall the best option. As I said earlier, I don't mind not doing the extra work, i.e., the bitmap/_fast_only parameters and the _FAST_YOUNG return value, as long as we know where we win and lose, i.e., simplicity and regressions. I would call all the potential regressions (the nested VM case, the arm64 case and the memcached benchmark) minor, compared with what we got from v2. But my opinion doesn't really matter much because I'm not your customer :)