From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC016429032 for ; Mon, 27 Jul 2026 17:24:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785173045; cv=none; b=J3nhsh6YCFvFAdXtiQn5nZkgAVwbwcmjp/HYHZj/HYpymCRqvHe8RgeetetYSPIJ6KWF+8YNZp4BLT+GmB7XcXn6XueiTHsMY6aLf98qUTJm2QcJKEot90S0ipXcikjsKztWyqXuqiagdugIvPh3mJgko1fUKCKfgn3qP8XN1Y8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785173045; c=relaxed/simple; bh=86xgqvGoiJYEvC6CRR4sg1jka1MinI8d71SGwIWWI4E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cO2vTg/XoKpXsAQAJ+MjVdpQyHJ3tSDolyT8wHm2mF0/tIUnCOLvUMDYBeIqCoZLxftnJz8JjNvEeiyXmVeub0skYngb0qRxyzjxvnm/dLgIX7+4Wm8jt4QJRZ5+iwfCAz/CHON8L08LRekCi5POvxbA8Q+oohtoGj05bsLK4ks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=Xi7pC9k5; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="Xi7pC9k5" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-8ff88549786so29809206d6.3 for ; Mon, 27 Jul 2026 10:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1785173040; x=1785777840; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=5/ZbfBCCG0jHDBCNH9TydT1nctmDeBJrWwsqu8EzeJ4=; b=Xi7pC9k5rYhfP1gTkYxi9O+6oip5EDkt/j9ELZmzPHuzj4G7HtJBF25x/IhTWSNlNR cIrYaaD8gcnWcJkUJNhai/10rrQ3QinxonklmhL8jF8dhsnMau/s/zQenExEdT7VCCNu cLMiew+jHP0yOELSxiOCW0cAjDXCsgb4Rl/eP0f1tEsSHpGezZ7X9r4z36G/f2cx4W/d qrGVCjL4t+xpQ2iURUBsD7Jk1yCWUyLdnbnCPbUVoQVzjOaI+V0/0fxmaMLOC90R/OHp lBessL5uQvY4DvPtbjp/L/uKbCioj97XvTsosnfB6B0ArNrtyNDY3hgB0LrJJorG40Ui a0UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785173040; x=1785777840; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=5/ZbfBCCG0jHDBCNH9TydT1nctmDeBJrWwsqu8EzeJ4=; b=b9SQsXNFt4CwDzLa7PnRVcLT31b/E30zRRhldfDJCxKtt7Bb4aNqprs58FPUStu+3j 4ekbYFxAyveVX/z2oP5QKLmhGqcDX6LasRoHTRirBMM0sNdQz2uStwgz6f1A1AHI9P49 0apEqWnC26eQN6iMIvz1lsU1DJQF0KulMQ9+2ycuypeYFYCHg9hNsGnkFZTTuUUKu7KS v0vuGLkB/bmfsTDX180LD/UVSu6xpykJs+0wVe/eLZ6QLyOUPl3DWFoR7Pyxy/ae+hX8 ieVG9MHpb58UPjHdYPHbt/Nr0gpDgMJb5oQR6j08Eztb3+3N+LxhjUUgfXKTboVyfeAZ 2Uzw== X-Forwarded-Encrypted: i=1; AHgh+RqqGtSJimNygrWyWoIUyKRJ3DoduVZ87Od57tNt6MMBJwit+1DWQCuGuNeVhyHegQAAi0/joYYJYG65iNw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0y2EoOtYVKFnTsxI9I033GI5SLUfNVhHozmBOJLBzuM3rqfdb 9UnCFjbEm88ieDLaoaodfbN5vMiINSn1lA3NxEFx/LjeHzvD+L3y4CqGs7cAl/A/MihUUo49lzy REVNT X-Gm-Gg: AR+sD12Uh3PmYWUCZQkzZh7LkpVUpiNKAYKfTCcUNYS+ACHah4bVAGt+E22qB3yD7qu to7CiWkB9Uff+G48YqVEmCITlW9EkgQWKcY/x4M7UhI+nHajvQcmfPtNNh1pHAdEWziTHr3Fzvh QIpEaMMcGu68jSP3DsXndqbfvXOaA6Ay5PR1xBplYLULCXVfEJHPi7fOpWqXcvMNc4esyFc7A7/ P9buJ/1alA59OkTE1bXugZo7RmEEM62La7u809hMrs9+0PvhzcS4J7gngiZ29h+sC5SvdtbalVM bZDiXoWLCE/dPE0Bo05Za04WaLY2dSdgi/ItaiCIAyjM3URA8CqsAvCXRKQLOawZMCH/b6PyOY8 E911iWH4vqEWivit8k7uJk1K2REuoeWNT/IWciua2LHMmQawayIfoPjqUH4BU0k7z1o3slCiZ1k G6aYSShSzemt6ht7DtTkI9/yiW0vTawBziMjm4cGbmQG3rK+S0dRlIy7EMPBpalhvA8bOOtNc= X-Received: by 2002:a05:6214:e6f:b0:8df:93d1:ca18 with SMTP id 6a1803df08f44-90812689696mr6173636d6.3.1785173039676; Mon, 27 Jul 2026 10:23:59 -0700 (PDT) Received: from localhost ([2603:7001:f100:500:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-907e858c4c1sm69737366d6.22.2026.07.27.10.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 10:23:59 -0700 (PDT) Date: Mon, 27 Jul 2026 13:23:55 -0400 From: Johannes Weiner To: Usama Arif Cc: Andrew Morton , david@kernel.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, chrisl@kernel.org, nphamcs@gmail.com, baoquan.he@linux.dev, youngjun.park@lge.com, roman.gushchin@linux.dev, muchun.song@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, rientjes@google.com, kernel-team@meta.com Subject: Re: [PATCH v5 2/3] mm/vmscan: add pgrotate_anon and pgrotate_file vmstat counters Message-ID: References: <20260727162550.2032-1-usama.arif@linux.dev> <20260727162550.2032-3-usama.arif@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@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: <20260727162550.2032-3-usama.arif@linux.dev> On Mon, Jul 27, 2026 at 09:23:24AM -0700, Usama Arif wrote: > Reclaim can spend substantial work on an LRU type without immediately > reclaiming or demoting a corresponding amount of memory. Record this > work in PGROTATE_ANON and PGROTATE_FILE. > > For classic LRU reclaim: > > - Inactive-list reclaim adds nr_scanned - nr_reclaimed to the > corresponding anon/file counter when isolation succeeds. > - Active-list reclaim adds referenced executable file folios that > are retained on the active list to PGROTATE_FILE. Active anon > reclaim does not contribute this component. > > For MGLRU, add the number of initially isolated pages that remain > unreclaimed after both the initial and retry passes to the counter for > the selected anon/file type. > > These counters are distinct from the existing pgrotated vm event. > pgrotated records an actual move to the inactive-list tail, primarily > after reclaim-marked writeback completes or failed invalidation leaves > a folio for accelerated reclaim. PGROTATE_ANON and PGROTATE_FILE > measure reclaim cost and do not imply that a folio moved to an LRU tail. > > A subsequent patch will consume these counters for anon/file scan > balancing. > > Signed-off-by: Usama Arif Acked-by: Johannes Weiner