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 9D69AC27C75 for ; Tue, 11 Jun 2024 16:50:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 322A26B0099; Tue, 11 Jun 2024 12:50:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D0156B009A; Tue, 11 Jun 2024 12:50:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 199256B009B; Tue, 11 Jun 2024 12:50:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id EEF106B0099 for ; Tue, 11 Jun 2024 12:50:41 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9AAAAC163A for ; Tue, 11 Jun 2024 16:50:41 +0000 (UTC) X-FDA: 82219196682.08.BB221D3 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by imf18.hostedemail.com (Postfix) with ESMTP id 590C01C000A for ; Tue, 11 Jun 2024 16:50:38 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="tDp/2AG8"; spf=pass (imf18.hostedemail.com: domain of jthoughton@google.com designates 209.85.160.179 as permitted sender) smtp.mailfrom=jthoughton@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718124638; 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=ud1eQBnt2jG1UKvvjxzK8+sntVYqlePqwphUbWfbcqQ=; b=fFEXwb69XmoKML1VRMpgwMpJA6So+taV6247tb1/RSw1Ec0qgC16bpOMnct7nbmoyyJfhX uBCgMkfnkN7m9oBjmQlKri0wf3ME6w95E5bdQfX4ggJB8jgyXbaMpENLn7ul2hOWtDAHZm 1Mer5grd+Z4s+y2LQIjoivzMOVNmtPY= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="tDp/2AG8"; spf=pass (imf18.hostedemail.com: domain of jthoughton@google.com designates 209.85.160.179 as permitted sender) smtp.mailfrom=jthoughton@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718124638; a=rsa-sha256; cv=none; b=OGQGspR6bE1hbDgZXrsOZBPR2E2o38/5EEPOdtHyI6+faCsscr2ysroknOALJ9SafDNLqO Sntl2h44UKObHF47jG1dK6bfCXOZ6VBcr7YwzyQOEOovH7EpvtAHPzUqIz34mttqgrZB7T lj2q0LsWxdYgSp3mJztdLibeqozfCcw= Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-4400cc0dad1so1101cf.0 for ; Tue, 11 Jun 2024 09:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718124637; x=1718729437; 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=ud1eQBnt2jG1UKvvjxzK8+sntVYqlePqwphUbWfbcqQ=; b=tDp/2AG8dCPmjFE21QcX4hFV+45rfc2SMopYEWfvuk0UdNavpCMo7W7noF1EoXm9vg GLKfgulzHDLV8gvcYX5V6nShTYN72j+xA7CMl64zUsHABu1nWMSApvVPI7YvqVBDUM+7 FQfmT/eYGdpl2zDaFaivCewFLUE1cmgrmR9DzOko7b1IBRSFoGhMAVnXK4Xahtj0PhXt 1mLDW96cnyvWj6oUo0pD7iLgeK4Om58LA88JL9OpYVKvAAPd7r8h8EdJZjKPsNLK6xYA QZIg3rQEtTizV40ay7HoqimMfStBjPsQnMv4X2DvXEPgVejYKDGutjZtjVutk3UPnA6v Ds1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718124637; x=1718729437; 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=ud1eQBnt2jG1UKvvjxzK8+sntVYqlePqwphUbWfbcqQ=; b=kyYdwGzdKZpsWJrFXHxv2zJrBepIQ6aX35KYZ93KWGyrGc/Wph9slytiAlkub7III6 UwWAfjvJwzGOicUHzwPraGf/quOKiumlYx/WQlbWToC996+TBvUnIm0kEziRoKFjn22P h52SWbjMHtdutjEqYOm5z0PvBaUO/iy6q88zIpdqmzek9SzcNgt5a6fqCzrqd0VRWQUy /wqD14FbrfkoQfPL0g8hpmC0LJoxPFXGTSK0/eQ5JeCYO4VysdU7/xc3h1uHUGRIuNeL 3/N5eqtgysYd6uN3gsLDZJziMi9CvVbwt/kSdRpjLBSUmVh1GVSd+ovkIWbsVFpj7eXL BJVw== X-Forwarded-Encrypted: i=1; AJvYcCXgdqR+QafSuZ6OeESHteFQUVeJqMyusgdguZgz9sKktzh1vvkmABtd8G+RnQ+skDUdCahkt7DoHF5vWBS6BOjkjdk= X-Gm-Message-State: AOJu0YzAftc4VOvYHTWUM4k8Ibhh3bNxovoncjPldl7U3TkmiS8uh94V Mv32mlwRfb7NiRZNmuAMlGqkxAqibbRZRx5H9UaNsCSsWC/SjJfiIaTLgID9S2mpcBrI6LpFUXq olGza/ZHTx1FQX13W5e8Ta6P3xvTaQKTvFASi X-Google-Smtp-Source: AGHT+IFTRKU/IN2oUvb5h39ozwdgDveDjgoFuty1h8DKtr2zokbWin06W/kJ4wicF03AaijkmKBkMyI8RF9KtoZUsSE= X-Received: by 2002:a05:622a:6103:b0:43e:3833:c5e3 with SMTP id d75a77b69052e-44146f10983mr2981601cf.11.1718124637169; Tue, 11 Jun 2024 09:50:37 -0700 (PDT) MIME-Version: 1.0 References: <20240611002145.2078921-1-jthoughton@google.com> <20240611002145.2078921-5-jthoughton@google.com> In-Reply-To: From: James Houghton Date: Tue, 11 Jun 2024 09:49:59 -0700 Message-ID: Subject: Re: [PATCH v5 4/9] mm: Add test_clear_young_fast_only MMU notifier To: Yu Zhao 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-Rspam-User: X-Rspamd-Queue-Id: 590C01C000A X-Rspamd-Server: rspam01 X-Stat-Signature: mzyegn77wcagek74od1emwt3kkuk9mda X-HE-Tag: 1718124638-245210 X-HE-Meta: U2FsdGVkX19pJ+zTzsphPdsHNZxSeG7uEeALZLh1itq+sQbbArNpyunlPqlFJaeZVUpp1W8ldnbN7e/k6ivGAxh9SEVdMylUk8uOE5XKyhDTy6p08pAGZS+bpIqgqQtgw6lDPO5kUWTI4GtjamFyDJkwMAUX4NnPw+0ppGAaPQDom9GO1WvsruYEH2EvFBKuJ3vVDojqs172n3hYr7qAMqn2KpF6R20EkprtKVYp+wFdDVqWUI6qvuPx1n7LmPX/ZzwmW1gzEpYOb8fbpi78kvJEZ4ssVPMHR4qTLriyUvQpRSF7KEzFsdhGWRvfQx5AoQVgACNykZt1bk2/5EgccJJPfc6I0GvuRPu0pR9oqip27um79xQ9UkNlZp7EBDdkcfBwVZadwr/YG1d0TaDb6AwiHwYt2J2mYl4HbL5Gma5r6ON3m4ifPRVfPcp8uj17rb2wiPhGg8ljqS8Nc20tQLQxLn70fdlVTcRchIXeczl6O8KoJVevSuvcJorWb9BlwOsGuZdZPUxiTASUQMI15Rv50+hSUJTcHzonzZFctJL8Y5ZZMcJ79f9eYvuN0ldvwOJKj4yPnZtvCsOj74H3tIzPCB9jlG1OSoaewus6RHDgjfZF6aoLnnB/nwYcBTOKT9stsE8ofzRpRu26KGad0w/iXm+rKSHErhdcJm2+n+KRDoFqANvrE8C2a3AVxHsODOXUqTLxeztxQ0gvnwvfjxWb1vX0bbZWzL0vq+8IlCZV0gJSnuq1yX5FmvrniXcD1yBSL3OuanrmHzmzzGcH88TMvT7OgCpuiY7LEZVWlrbgmpBPlnMl6jbHw5qhDM2i4ZgBxYGMhu6233UodH8Hlvlm5O/m+bXSjah2fBVXqDsNFTbZQVkN5xDov/X7xOIqyzgrFWccGrhj1q3GY/dRLRLFX0+HN0KZXdlvgKUmEjkOAQDkH6HTzx/h7YohrJcNnVhrk9IhQ54rh+/HtKZ cA66TY3O bt27bzfhMaZk2jyLhmOcprfuZ3T7kvgFVQjkiJMYXTfXF06hlIh17DG0/IcOpY2b6wiF9tHdD3/RFQ9wKuInseangpvGZoj0gwG1/nQ7vSQ/tIyl3p8CiERWJ7q9J06UUvujF8I5irIvEHYMPQYWYnZkLnbUENr+Wt1pE2TW7Ecp/dKVrskgl0vNHEUedwPFor+A5q468h60kC6w31/siNDrOPx+yjGTvZaGKRlXmVDSbhzk/a7z/DsyWvmXzhRbv1RFeV5CJbGW9E1r5tdrrZTXpLp5MYia26HPN X-Bogosity: Ham, tests=bogofilter, spamicity=0.000015, 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 Mon, Jun 10, 2024 at 10:34=E2=80=AFPM Yu Zhao wrote: > > 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 ca= n > > 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. 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. 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. [3]: https://lore.kernel.org/linux-mm/Zl5LqcusZ88QOGQY@google.com/ > > [1] https://docs.kernel.org/admin-guide/mm/idle_page_tracking.html > [2] https://www.kernel.org/doc/html/latest/mm/damon/index.html