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 1AF54C27C4F for ; Fri, 14 Jun 2024 00:49:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04B726B00A3; Thu, 13 Jun 2024 20:49:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 021E46B00A6; Thu, 13 Jun 2024 20:49:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E043A6B00A7; Thu, 13 Jun 2024 20:49:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C21EE6B00A3 for ; Thu, 13 Jun 2024 20:49:02 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 50CD7120385 for ; Fri, 14 Jun 2024 00:49:02 +0000 (UTC) X-FDA: 82227659724.13.DE9B4FB Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf23.hostedemail.com (Postfix) with ESMTP id 8235D140004 for ; Fri, 14 Jun 2024 00:49:00 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=aNWucoNc; spf=pass (imf23.hostedemail.com: domain of jthoughton@google.com designates 209.85.214.176 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=1718326138; 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=Cs3I7xb2JkPfyVWwhfDDItDBDpUbWjmYdCsu/iDXVRE=; b=HlewUXKBsrVmyKv3c3cheRinKaetw3wd3z2vm96+iDm0x48txolBIM38Q6dbizIAsjoJ4c 0ogxHk7K3RP3bJlLXZcWfErYJQL5VlW4oG7W7lakUa0UMkXqFujtwr5J6CZhpBNxna3Jq5 z6YUmHVFwWqeVJhcnUk2adeoh82sGCE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=aNWucoNc; spf=pass (imf23.hostedemail.com: domain of jthoughton@google.com designates 209.85.214.176 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=1718326138; a=rsa-sha256; cv=none; b=e6bXoNA1mPeUhaTrA4CE/2dxblJAsFmGYIzKqN3/pgfvDRphVJQTO+WwHnnOEvjkzvbom6 IAyDYSYdcXcbP5lcwFU9UIjZfe4qwr1+x+MXObqut1xpoe2hy+5VRN3LEJ2rxYM5KsUxcH c7SKYEf+Vql3EiizEBaDRvp9IVxpJKM= Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1f70fdc9645so52805ad.1 for ; Thu, 13 Jun 2024 17:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718326139; x=1718930939; 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=Cs3I7xb2JkPfyVWwhfDDItDBDpUbWjmYdCsu/iDXVRE=; b=aNWucoNclCmeftr9uMfI2ZAnS8UBnxGvzQMul3Kxg37rmTyxh3xqQCIO6TzuvU9Ayn RmEsNUF1leeSFkfDdxcGgC43/+G5AjZdfEFO0IKRH3kz0JfgHiRNSHWoi8X/7zko10Rg /6enqxXkKYFWdBIPvrAC/XxO9uOT1SeglaHxS8pBVpM/ZRW5JZR5IaonFJndjjDOOZgv pk4R8WFTq64w5GrwN6UcmRY48m6ygkh/e9J53UjfcoXYyvBpAKeFVXmV5gm0Rxm21yx1 WZ9G6I8aYR3GXkb7RLXIBqs73WzDCLisvbDVqxKCgog/eurCqKrTyCwT5yvYU9tOOTDf 6NAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718326139; x=1718930939; 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=Cs3I7xb2JkPfyVWwhfDDItDBDpUbWjmYdCsu/iDXVRE=; b=df6JRUS6OMlmXAvMIGvZU0BwErJAL5spnJf6jQACW69guGMqMo1gCLYkbdnN74TDUB 4U2yqzOULE9pYMCUBZRS7W/C+j4so7NRUxjUpOji+uJA7BNHFmhA0g04faLuwYVTEXTF so9S4shik+4T8CKObx4z2nJZTcFswzRbA88tCOgiNDZWp02Iz+kw9czAQR52nqr+EWzl qyrFUJDH61p7wQqvDPn8QkD/gBiqriuVe27euNaD6AC9346eA1nhsaP1nrzbJcNVEn6P NIP2VlvE642p/Ls7rG73TLVCdG4h7Bhawm5VZgT8BUr57GWTUEuGYvfBbkE6q+UlxQwf EyhA== X-Forwarded-Encrypted: i=1; AJvYcCV1W2fQFrwTlsaBD6TrHMQflNh0k98ZA4nngnisJvyYpqSD8+Bgh+BMmJsP43Fa8YNjOqHmjugFlOXKBJExTPbklUQ= X-Gm-Message-State: AOJu0YzLFcPtX8AeiGto6aJ0Z14mJsD1xKsn317PlWwAnrIWjZWpiuJ3 JFH8etPg1+190wheHf9LdnBuahi6v4FCybwVrXGzU1uB+tBha6Q4jgzaxS0KzkIE+Ixm85TsME2 VdxpYKsKlRxu+cyFFty6bEgiw0WD+26kEbhOJ X-Google-Smtp-Source: AGHT+IG4rh9cysMLIjJvQTQbAGIfEWjp8FbFtGimlgyhxAwv6QoKwTYp7w2DNRBP89lE6kBTdOWPtAittybnD94st7Y= X-Received: by 2002:a17:902:b782:b0:1e4:35b9:cce0 with SMTP id d9443c01a7336-1f86777297bmr804415ad.9.1718326138884; Thu, 13 Jun 2024 17:48:58 -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: Thu, 13 Jun 2024 17:48:22 -0700 Message-ID: Subject: Re: [PATCH v5 4/9] mm: Add test_clear_young_fast_only MMU notifier To: Oliver Upton Cc: Sean Christopherson , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 8235D140004 X-Stat-Signature: czt5uy16jm1ck3fjhcpmursogrpe1mhj X-Rspam-User: X-HE-Tag: 1718326140-893932 X-HE-Meta: U2FsdGVkX1/Q/6TMPa/A6qxaVaq5jIIddLBeWDIBZD+Td1krpBEuPTcutuhRYMMarL/PQj+xBCpD2LGmpQ/WymYlGwmGjh/JDHQd39GLFa6ZCr9IkfaPOcNzj24MuB+DOuHf74nZ6ifkZOFQ0UVqSxkAfeXigAebNHZk5bZS726hPm9FQH4kXdMbPrOkBO63j+v9mbOAZwHZUON1KvW3iCPjq5mXB+InEu+FfdWE2hJdAQtXczFKBtruJzKx3XYQrwy/fbJKLaPH9RblftE8OimVAjY4sOVcCwiLeM8rCHyLScshMRBvS/SvKs4Pnvuq4XgJ08jgcUcsziNTJP7sctY6wDLRjYV0jLhQB7yTEDahDErpC2uofUYWGjwbbxhQoNmkP6oR0qLQDTNTH6CpAJq1QgzsMiw1D9vNzBeoG6Jqxa0gwy7snoimEXIxp5BsF7St9/gezuiuAZzvM3TjF4O0rHclGbINrLiBeMAG57awI+SjVw0wrPxj2QIHz3VjVZtWZkfrFFyrMi/Cz2t349qsNPJSsabAt5RzAbKVPdPkEoYU5pAWGiEEv0TVIH1xSpueUoeDONcSPyYAS/NYzNeFbKLhX9V5sSHhicF/Bx4L33IwYSU8LYYAXQiR0lHu7SJBtdIooImnyh/n/Gh6D6FrXe3WPTXA9K7DrmCtFR7y/0gPK6EdTuX9ksjM0U1flqxR9Xv6W55HqbLW9h7wzpqOkXJcly9f+nPPMtodL9fkiYLtgYJztB1wE64p+jb7tKuWLQk1Reio7QVzgZrQU5OXsJllluzkQ8Q+78OtWdbEQF5MAOXb5YVyyfcXuYKpyZSHfqAo3lqIQGoD92Ptayw4B8lSi5fAsiaMqM7N9rYKZ0MM99fW4e5gQD1Tcayw0Xr2Nh2PBvjO7i6eRQnbvuVUcF22oTU1zqHIBwfcs7lqNEaWVPEAhfPhPUxKoerl6GzHHRMFO9v4SY79+X/ xRTW8B5l PrwLxTEccL7kx374CGXPFomwTCzaovb6vg9z45s4DToD4FiUDirh4XosEegI8wWyxct/8bNh5t9v3d/gYRcxVzvwjBGDRReM2udvkc7VSNQKSbppKCcGhy4bdcGZEcO1wDYeHb4G72Dm7O+/YUm3BuaCIcsL5u01bJ9wlLN/3anWJtmSAvbPNTeH/o4TTxvDQ7LZROKnUnow+YkNNYZOALPBurw== 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 Wed, Jun 12, 2024 at 11:53=E2=80=AFPM Oliver Upton wrote: > > 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 consolid= ate > > > > 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 achiev= e that > > for the callsites, e.g. ptep_clear_young_notify() passes fast_only=3Dfa= lse, 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" a= nd "slow" > > paths back into a common helper, so IMO having dedicated fast_only() AP= Is 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 pa= rties. > > Yeah, I think I'm headed in the same direction after actually reading > the MM side of this, heh. Yeah, I agree. What I have now for v6 is that the test_young() and clear_young() notifiers themselves now take a `bool fast_only`. When called with the existing helpers (e.g. `mmu_notifier_test_young()`, `fast_only` is false, and I have new helpers (e.g. `mmu_notifier_test_young_fast_only()`) that will set `fast_only` to true. Seems clean to me. Thanks!