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 95C45C27C65 for ; Tue, 11 Jun 2024 20:39:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07A5C6B00DC; Tue, 11 Jun 2024 16:39:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 000D86B00DD; Tue, 11 Jun 2024 16:39:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D95D26B00DE; Tue, 11 Jun 2024 16:39:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B8CB86B00DC for ; Tue, 11 Jun 2024 16:39:49 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3471340975 for ; Tue, 11 Jun 2024 20:39:49 +0000 (UTC) X-FDA: 82219774098.27.9E701F5 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by imf20.hostedemail.com (Postfix) with ESMTP id 60C2A1C0008 for ; Tue, 11 Jun 2024 20:39:47 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=X6vBNzfp; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of yuzhao@google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=yuzhao@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718138387; 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=Uwv7P+rpbL3D4lWasBXzA1FdWhb0FlRL25Aj/PT5ky8=; b=pBSC3e/RkmCrKkHW+lafUN2yOIuSIIJFiBnDsTBAuQE+wUQUBJbBYVJP4p8WEIAemEsIg5 EPhrms/5K+K3VUM08TEicQQo4ZntZMdPUl/MB4KvvgwrganbgwZlQ5fVvKSEugFjU+kQiM MQUEMjV6EHtyuHvkNlh4uQGFjk/OE+w= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=X6vBNzfp; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of yuzhao@google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=yuzhao@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718138387; a=rsa-sha256; cv=none; b=wLSmAIi8Jp8R0CLh0l4kpvSpITLu6Sf7oUs1QMUm7/caXuHnudlF5HRsfIKQ1Km4dPUz28 R3r9Ottsm6RVItrYIIe4cC6hBKq9HM4B4coGvl2OT3Bew+PVi5bqXPkNbt45KTBqNyWNVs 6GHh+MoNKJpE5JaIk06zYOr7ME+Stvs= Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42175bce556so2355e9.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=kvack.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=X6vBNzfpQhwZbzyYzMKSxI9spkab9+8ZJq7Z41I3aPEGXiCBQZjXPpiS1SnfmtX2ht +OhVnB8zFazyOvQtDgWbmse/eFWcZixClujBLyxSJD3Re/pbUUtSJfdzA6/jORGAsXXS 0ShyxeDn6VZF7VViCMD4Ceoq6iNV0GacDe05Ltj3me/0wTmpbpaCZ2UBQUumxWGn40w5 660sNd7NBqQDbZrcHPg7Q2ot+MdyHX1vFG8BVNptOwVd7vY1B+o2EfFQA0pyV6ySHD85 oCDqq+vDPpKyRBa8AxuxeS41ijxy6FLpnnIwedeQ41t7yH+PcnbD3IOrp7BwHnTciMHU GI6Q== 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=h8brgsjHyFnf7tjg5lpiOAaICZufxMPjvfHOxaVGFMAPtwsltH5m93QCJhxJ1bX6mI VeZzS0S2FBfS5pWBUFM2aMORg3X9IaXxiqV/xSP5x9cncqPQzd6AboVdf0C8HKJqs3Vm 5ARValD313fZE1sSDkU6oluv6BlVRTGbZzyE5plSO67r9bN6S95hKOD6A3SSML3iyERP Qvma2XHNQNuE9RBEGWTd8nS0jLs0OEMDOmiO/M+yC8wgkxH8KmLHb06gtgv35mTItbgM Rxr0ey4gkJKvaqVzN6p1OV9DiSpCT2UuNFpSn5kq+Ti+LPyoUtMCrzI0zj6TBllBcwvC QzRw== X-Forwarded-Encrypted: i=1; AJvYcCXisGzh0JgGtVa1R7gX1L6WqgYdUQ72fQQ8BX0Xq6RyIbweWyE7ABhUNSHfjLREOtr+Aoxdk/AuHFt17QF9BIw/kLs= X-Gm-Message-State: AOJu0Ywkx/gMSIoQ832SSMvNahYVAV+ciAhXpCrOEIGwgKcU5Wkfqf4G iF4YHlHciU3VZ17XB/qAiw7Wisbh8scrNt/kJe0naPLWB5FfHsnlr25zAfb2mchelqi6kK8j7ar Qk84S5thnqp3hlkpoVsFO3EPjkP7S2kMF+NXg X-Google-Smtp-Source: AGHT+IH+CbdX5Jd916IabrKfbqeWvGCL7LL9WXw1sJsxc+uDAViKu6aEHqBlAMyLtMyJTX4kNPtqpJKHeoLv1yDsgn0= 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) 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 X-Rspamd-Queue-Id: 60C2A1C0008 X-Stat-Signature: egp41qc89hzamxoi4qxx95iiyjdba3p5 X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1718138387-395922 X-HE-Meta: U2FsdGVkX1+MtxVV5vQzqGbBkCZdO3T/apW3n+HYcUD2kg+EOCaL5kSDbWqpwq4Afu7oS7MbFq0T1UumT1Asfzd+CPmhujTNH9TX5IxXR41raZQR0st6JyvvUk8WvBoFJfnBtTGnHo1M6nGQ9xol8UBiL0bzr4m3T+viSccVaZiNcxH8vNlSwylnHw4eQNLv4cp3mIgXVbVyU/dn7h8kweLBJsbeM82hF5/mfcixSfE4/sFs4WkjEtuz0uobm/3sPkrKp8iDehn0c3BZM4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ilter, spamicity=0.000202, 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 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 :)