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 26A83C3DA59 for ; Mon, 15 Jul 2024 23:15:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B83F6B0083; Mon, 15 Jul 2024 19:15:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 368466B0085; Mon, 15 Jul 2024 19:15:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22F376B0088; Mon, 15 Jul 2024 19:15:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 05E546B0083 for ; Mon, 15 Jul 2024 19:15:47 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6DE801202E6 for ; Mon, 15 Jul 2024 23:15:47 +0000 (UTC) X-FDA: 82343546334.10.90989AF Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf13.hostedemail.com (Postfix) with ESMTP id 986F320026 for ; Mon, 15 Jul 2024 23:15:45 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=MsEh0gyU; spf=pass (imf13.hostedemail.com: domain of jthoughton@google.com designates 209.85.214.173 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=1721085308; 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=exEH9iPNcIg3KpVyQ+q3mCt+4C/Fcr8/ESkE/4SO1o8=; b=5haZF2+9UjdIEpXmfK2yYjBu89bGzRvluC2dtelRyStRUMPfg9RKnRaSerlLOBfGLbACOl oZu5KNOlhUXoYCEZIN3AT5X+8G008TBMr0eNppKeqWFz9FslJvGX/itbd0+WjDBN1FXxzG EaMvIRPFzYnPEVWORuaogeYbcmk9mIQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721085308; a=rsa-sha256; cv=none; b=cm0SQebRyOfrhM47YR/VJKdaqVKZjh6HYL9d/Yyfdfg/WGCUjcvAIfyKyS6oV+/uIkfiHs hRGp5vLA4hOo2yfR6FkHEqhmpu0jrDKeWPctjzLltX19rK4Vkyd/SnF00BchdYqNtUElS3 b9O9So41EQiXSc7Xj/RdjMbwJfkzqaA= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=MsEh0gyU; spf=pass (imf13.hostedemail.com: domain of jthoughton@google.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=jthoughton@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1fb10519ae3so41305ad.1 for ; Mon, 15 Jul 2024 16:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1721085344; x=1721690144; 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=exEH9iPNcIg3KpVyQ+q3mCt+4C/Fcr8/ESkE/4SO1o8=; b=MsEh0gyUARTe0mD88mLJDsa9pdHVert73mydWQ2EfceHD7DT25fkEYloSl9lOFdbSK 3l7uuf5ch832lcpefrExhsmc3hJEEm+Q+HFByCgVE1U0etJQOF0ZBdllbJX8We80F8/l hObhpqeXn3s9/qIP900odMXIxkSIfP7fLGLzUhoIbOtaoJE5d+pRGpuJ9Y9RHkRlKXbp AMEn50I2Q1EterERpzddsGnrxA14rmUV87j+vapRrslSMuNCir4CJJf1Gaa44dLwNFqI AuR7t6H44X5ChVzwj04noMEBn23h7AsKOC98NfYI14aTxmQPtvrzV5mSd3f8Po9DHUCX Cb0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721085344; x=1721690144; 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=exEH9iPNcIg3KpVyQ+q3mCt+4C/Fcr8/ESkE/4SO1o8=; b=bcdKlVr67y6pPUJ+xj3YZCK+VNNc5A+8nsdLDftZ0D9g0TxhhEDExe/RF2HJZiq7Am 4OyP6UiBVD2gbocMvRwfDMFRmxns21v606muAn8LiDx4gt471KRSpKlYk9PZe6rHWZ3W g9NjsjUQRx42kR6H4asAwKrEuWaQFJimV29kZud0/PNQS/11UmmZxLvjPLuE5gjwVOy2 hvfL3DzptL4flEejaEIki30XDcnFW8wKchDNwD6Bbxh5KNMs0gudnTjytyVoKww6E9PK +Ej3+5F13nRV/Hcvr6rXX8+zCEBqwUfk6IzXm6wnQCBNNsnFB32gNWzzD90ygZYcpLx0 3V/A== X-Forwarded-Encrypted: i=1; AJvYcCUPIirrHsd7nlZfBpLO571f5Hsi5fDH5HwCK9HmYRg7JZxeSUU7NK7EJJgmPra5SJWmRfD3jwmHHjpxX3uPvBLhwjY= X-Gm-Message-State: AOJu0YzrKJth+X9u0qf1dLYhi4HtnivWlpVjb5MB+PPVEvmzDheP+yvd 8OFolL/tNBjMmNq/219zLtMo6S/BIv4lzdo2K5jbXgfJqciZ9sPQlCXQ0L49jab7XDOxVIv8Qt7 YNFeG5XoIw7B+XYjN8voAj7/JrVlg66j/k9Ga X-Google-Smtp-Source: AGHT+IF37bptgINSCLE9dDjInkdJLhm19J5sk44W8p8j4cV76p1iCJXBcZEjJTiahXiPn4ncuCw2O5xLUjXDk1VNB9o= X-Received: by 2002:a17:902:f688:b0:1fb:2924:5c7e with SMTP id d9443c01a7336-1fc3d7698a7mr591975ad.11.1721085344002; Mon, 15 Jul 2024 16:15:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: James Houghton Date: Mon, 15 Jul 2024 16:15:06 -0700 Message-ID: Subject: Re: [PATCH v5 4/9] mm: Add test_clear_young_fast_only MMU notifier To: Sean Christopherson Cc: Yu Zhao , 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 , 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: 986F320026 X-Stat-Signature: jx9noyknwfnroix8qtsw7u3zmzdhqwzx X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1721085345-458138 X-HE-Meta: U2FsdGVkX19ktXejz/szHlLINUnGNwQIr6rsikNFJ54o0hWmdmWpnJW8z5bhVs652omp58+a2BLN2yPnFZQtA6KdxCADXehDfPP2mTPa/f0MQ23E4yDNKCQ3/ydzxTQATjdZwuaKRclbNRqU9Oq8XhMxfyTyPN5+DmymH8v6ueNJxSitxsyHFqq6YAQVb4WvVh4a5kZbUJyXZ3A/mHCu1qKAoFy1UyMp2Ylct5KBEBPcoeLo1eyo109EoMWBxPQeMydoD2kj5E5xd7e25dzJIzWobnUTtCB0DVKnEhbjuCPXstTxUJpB9Y8sFMTnEhzB0wUl/8HLLONQN5CRTYdl7WvZqIa0R0GHd6pjcsJtWZ1uOQlxgBK+oJCKCDuuQsD4DO7KCP1iQHeuro17s+815+0zI9iCFh3EVuwsQmTiykrEtfKqs4yrgtBVJbQ2BJkEWwoL3ZyCgvnnDPvBRXytRn04VTGwBUmdSUelhfvVy+Y9/DihTkLuDoN2WhxXIC9p329Iql47nLMECsK+TML2u4IBQhmyZLRlxvupKrezaqpcKq12LsfHIUDy2i09eKGKVDH2OhzENg3HmyEdZ7EnPI7tUsj9qM68tEgvAFqNmt3idtOZ2K9ROQZYbPg8KAY9qPbyBjgFWtZc3HwmOwUMtQEy+yhs7kGYfK5J/su1cOWGDVEi0o/fo6NFp1L5BA9PBJjEfjeaGe0HKmlUwjzRhKkUfZZD1XP38sRkFtrDDf8v7ldWnV7YefNraHtmeAWtfPkHmlBNfnaEVjPvYix60H1HNIYPGyb9f2yooHR+9ZHysOSIqiEQxVQ7CX6Yju+aGianrwi8l6jSyWRCPZSfcQjcaKV1UfXJSc/GYnlTCpspumjDkAM6okB9Qdi90GohTGsB4WKD9ZTfEjva/lNi9cjQJPG4424dy9pRmPoWmEjVmAvJOzQ+UIg4j/SThx7dZLFDudW4WNSFQza5P4L mEZuPYEp /8UGC5lHPV7TzSv4Jo+C2kTE7GufmYETkThly2Lywz0aI+U4OQePw3XNQ2n/R7FXMe2PVYvdhr6Tr6JyRTfq6ZuPCYUNeheylaQWIARVfIHtfnYpEZx87b9jFFZoyaV0jJ9/KEaXB2S6xTyNuTQXFJUWdibAxGdRGKa1KmskhmcjkVwfnykX+T1K1+cEJcRNtDHxosjuWu4yjYdzX+Bv7OAIXNV9w4Z2YZ0ucOwwRhm/ikzY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, 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 Fri, Jul 12, 2024 at 8:06=E2=80=AFAM Sean Christopherson wrote: > > On Wed, Jul 10, 2024, James Houghton wrote: > > 1. Drop the WAS_FAST complexity. > > 2. Add a function like mm_has_fast_aging_notifiers(), use that to > > determine if we should be doing look-around. > > I would prefer a flag over a function. Long-term, if my pseudo-lockless = rmap > idea pans out, KVM can set the flag during VM creation. Until then, KVM = can set > the flag during creation and then toggle it in (un)account_shadowed(). R= aces > will be possible, but they should be extremely rare and quite benign, all= things > considered. So I think you're talking about .has_fast_aging bool on struct mmu_notifier, and we would do look-around if that is set, right? So we'd need to have something like mm_has_fast_aging_notifiers() to check if any of the subscribed mmu notifiers have .has_fast_aging. We could toggle it in (un)account_shadowed(), but I think I'd need to demonstrate some performance win to justify it.