From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EB40260566; Fri, 24 Apr 2026 13:50:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777038610; cv=none; b=ji1sRme02ouSMz07pjnF+ur7jFTW0ZoSa0QeItm1kKrvjFLwj/zTRox8PgBLRibO64d8JFEYcAdiLyE1PP+N7Ujq7Jl76x4JsolSIqUvfm3BztbLgTq5kh9JIu1Y1O3YuS9EIPmGQE/ysKUC6S2zeiJDcGZuMc2xuS/oqUeecH4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777038610; c=relaxed/simple; bh=MGl0j903w+i9Y389Y47daupOrHc4r/683a0T3qETTzU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LZx+mtMzpAL0jIZj5kHbtl+BQwtTGm1iIBSWoUeu0vu6J2ksEJ6+1HLumPF9iQMNp7S/E1jzc41HyiVMnA3LKB4+54iu0dsmvydYEidPZr4dSQ/W77FMdT6Aub0afBl53gq2AEvyIoZe273DxAy4Miy4cOJ0zZtDEmRCWdMQY5w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=foOAimJC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="foOAimJC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 773ABC19425; Fri, 24 Apr 2026 13:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777038610; bh=MGl0j903w+i9Y389Y47daupOrHc4r/683a0T3qETTzU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=foOAimJCsCw6yktvneSSk02PdxdoSF2WhhGvPLNs2HPUVBNxJBdoSL0QPUXTJ0yT4 kcHqG9Qt7AsNhAGcZJtAbAYvWtZbJL6iCQAoOr/5udi86INe1cQJphWTsENK6TRg6i 1niOCdLjbHNaYim/DUOHJjPIJvd8jzEOQaa08t5QohfL9IWiwMfHH7cev0XGxCl5Oe f1J+cmLCCpdDOIbEGt8zzAlnQBiMawXx4cwgMAPVlFUb4GZikcZnka0Wc9WBRzcJ6h yE7xB8jkyglV/08h8g40aNo58acSjYbjKtljAhcMFOmF1yJkLo8jDXwNBYNzwQsOAv sTi/WxnWlBLng== Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id 8C6DDF4006B; Fri, 24 Apr 2026 09:50:08 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Fri, 24 Apr 2026 09:50:08 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdejtddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefmihhrhihlucfu hhhuthhsvghmrghuuceokhgrsheskhgvrhhnvghlrdhorhhgqeenucggtffrrghtthgvrh hnpeeuieejieffkeehfeffffdtkeelfeelhefhfefhudehjeehvdffleeuvddufefgkeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehkihhrih hllhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeiudduiedvieehhedq vdekgeeggeejvdekqdhkrghspeepkhgvrhhnvghlrdhorhhgsehshhhuthgvmhhovhdrnh grmhgvpdhnsggprhgtphhtthhopeefiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepphgvthgvrhigsehrvgguhhgrthdrtghomhdprhgtphhtthhopegurghvihgusehkvg hrnhgvlhdrohhrghdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhi ohhnrdhorhhgpdhrtghpthhtoheplhhjsheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoh eprhhpphhtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehsuhhrvghnsgesghhoohhg lhgvrdgtohhmpdhrtghpthhtohepvhgsrggskhgrsehkvghrnhgvlhdrohhrghdprhgtph htthhopehlihgrmhdrhhhofihlvghtthesohhrrggtlhgvrdgtohhmpdhrtghpthhtohep iihihiesnhhvihguihgrrdgtohhm X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Apr 2026 09:50:05 -0400 (EDT) Date: Fri, 24 Apr 2026 14:49:58 +0100 From: Kiryl Shutsemau To: Peter Xu Cc: "David Hildenbrand (Arm)" , Andrew Morton , Lorenzo Stoakes , Mike Rapoport , Suren Baghdasaryan , Vlastimil Babka , "Liam R . Howlett" , Zi Yan , Jonathan Corbet , Shuah Khan , Sean Christopherson , Paolo Bonzini , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [RFC, PATCH 00/12] userfaultfd: working set tracking for VM guest memory Message-ID: References: <34f75083-29a3-4860-8a6e-94551d37ac6a@kernel.org> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 24, 2026 at 07:51:44AM -0400, Peter Xu wrote: > On Fri, Apr 24, 2026 at 11:34:48AM +0100, Kiryl Shutsemau wrote: > > Both page_idle and the LRUs (legacy or MGLRU) track accesses on physical > > memory. We need visibility in the virtual address space domain. > > Yes they are, but ACCESS bit isn't. A-bit is not a reliable signal for userspace working-set tracking because the kernel itself is a concurrent consumer. It is exactly why page_idle needs PG_young on top of the A-bit: PG_young is the "kernel ate the A-bit but the page was actually touched" escape hatch. And bringing PG_young into the picture puts us right back into physical-side tracking. > For migration, see e.g. remove_migration_pte() has: > > if (!softleaf_is_migration_young(entry)) > pte = pte_mkold(pte); remove_migration_pte() only propagates young-at-unmap. It does not cover the common case: A-bit cleared by reclaim before migration started. The concurrent-consumer problem is what breaks the signal, not the migration boundary. -- Kiryl Shutsemau / Kirill A. Shutemov