From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EA4C606A322 for ; Thu, 3 Dec 2026 06:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=fxDIK+MO Received: by kanga.kvack.org (Postfix) id 6B69D6B05B2; Thu, 3 Dec 2026 01:43:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6193A6B05B3; Thu, 3 Dec 2026 01:43:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E1526B05B4; Thu, 3 Dec 2026 01:43:41 -0500 (EST) 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 297466B05B2 for ; Thu, 3 Dec 2026 01:43:41 -0500 (EST) Received: from smtpin15.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A4286805A0 for ; Thu, 3 Dec 2026 06:43:40 +0000 (UTC) X-FDA: 85501731000.15.F19978B Received: from mta0.migadu.com (out-231.mta0.migadu.com [91.218.175.231]) by imf18.hostedemail.com (Postfix) with ESMTP id 61AB61C0008 for ; Thu, 3 Dec 2026 06:43:38 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=fxDIK+MO; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf18.hostedemail.com: domain of qi.zheng@linux.dev designates 91.218.175.231 as permitted sender) smtp.mailfrom=qi.zheng@linux.dev ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796280219; b=jM9ACCM/QGrhqcEWZ9MypAISymxS7uaZ1eMseZ2whp1DVcDh70RULedyYyEA3Nm2m53bsm gYPsPvbw8kb4ZguKN1ZIDzvN54UKUbwLvi4HRy3/s/HvFIhUq+OoTyZGOcYLIQ3WuOk++I mUsYQCy251jc6et9XHRFx+KePKAdQVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796280219; 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=FJ3NvNeZFhxBK5Q/Wt6+x9HSK/nuMnK4ocMWN8amH/E=; b=RVMrZ9xJfMeYPTh5TAvTAZlRSFPgbZstseb7IZb9SipqkKbJUo527xMCNuAAdmUhxwY53p OP+fwzyQEt/1OtPaqKqkSJZ8XzQNX2DZbPVXmKRKpzWF30uB6E/E7SgTXIZ+0EPfcaMrYT j/uSmvW4qswP1k/F9oi1wqAaCksHUx8= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=fxDIK+MO; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf18.hostedemail.com: domain of qi.zheng@linux.dev designates 91.218.175.231 as permitted sender) smtp.mailfrom=qi.zheng@linux.dev X-Envelope-To: linux-mm@kvack.org DKIM-Signature: a=rsa-sha256; bh=qtw2voJWhgxwGpCWmQKzhv9jGxNk8Px1gt+Lnlgw6LE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796280216; v=1; x=1796885016; b=fxDIK+MOLH3DyyRJBEDAZpQXJJr6AzaairnCJV1zkv5PoOPGMWTTMqbKMySUPEgUZGSyiufa VbHRKqQ3kL4tyT+PgJoFo+crvDf12HwJc0Gglf7+kdg8ZIuVLlx9Ewgbt0O61N6OW+roe9ZW4xF U10uI8JRH3kEM9Dr1TE2Kh6M= X-Envelope-To: linux-mm@kvack.org Received: by smtp.migadu.com with ESMTPS id b452fe735176fd4d; Thu, 03 Dec 2026 06:43:36 +0000 X-Mizu-Trace-ID: b452fe735176fd4d X-Migadu-Flow: FLOW_OUT Message-ID: Date: Thu, 3 Dec 2026 14:43:12 +0800 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] mm/mglru: fix the outdated can_swap field of the aging command To: Chuanhua Han , Andrew Morton , David Hildenbrand , Jonathan Corbet , Kairui Song Cc: Axel Rasmussen , Baolin Wang , Baoquan He , Barry Song , "Liam R. Howlett" , linux-doc@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Mike Rapoport , Randy Dunlap , Shakeel Butt , Shuah Khan , Vlastimil Babka , Wei Xu , Yuanchu Xie , Chuanhua Han References: <20261203040003.16978-1-hanchuanhua802@gmail.com> From: Qi Zheng In-Reply-To: <20261203040003.16978-1-hanchuanhua802@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspam-User: X-Stat-Signature: u5kdhoi9ahabhem95tmzrm8sgp5w4xxs X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 61AB61C0008 X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1796280218-513425 X-HE-Meta: U2FsdGVkX1+aP1LrLbIg7XZZ+lEYvXZywqTE0DWFwkRmDSfUoD2XkrCQCVcIQ8vDHfkm+BBnE+fPaX8OWeu3B9RSeAXbZfnIxOwRL5EAkngSM4HUNAcmpcj+4xqNiorF78XJwfRGNHHCN0eSrM/YUIUjomvcOuDAqzuUVP9/Lyp6mRlKD9sHVSOjJcYNIwrme3ngAUpBAY18k9stZNomnQDq9tEY9AohOOG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Eay1C8PUzP8Oi4OAE5igtzPdGofd4szOrc5D9QMyYjpb94IVQCD659Ba7yy4yQIplA6O4QEd63X0tkb5vdLx78C7j8umgFuVvZEMrqA+Thw0OUBYX0q9/a1x6hbZAWhFa/7pgPtXS9dfvW3GScf1P3/s7Xn8CIJx6xAwZEQVc+/2nNk1uk31Jt3f/2Yu00S8yoJbkiCrkqrIlCV6NMqeqHsFeuvhUBI4rMt3fPDR0kGpI9F63Eow0cVzxZFs8S1o4U4kQEhS855rccMCT1es5Acyg/KrFK/ExYCIf4JVmC3aysB1inlyXRHzMWtq8iZ/TDqe1cK Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Chuanhua, On 12/3/26 12:00 PM, Chuanhua Han wrote: > From: Chuanhua Han > > The fourth field of the aging command in /sys/kernel/debug/lru_gen is > documented as can_swap, but lru_gen_seq_write() parses it as a > swappiness value, the same as for the eviction command. > Commit b40599930f00 ("mm: add max swappiness arg to lru_gen for > anonymous memory only") added "max" to this field, but documented it > only for eviction. > > For aging, the value decides which VMAs the page table walk scans: 0 > skips anon and shmem VMAs, "max" skips file VMAs other than shmem, and > any value in [1, 200] scans both. Document the field as swappiness. > > Signed-off-by: Chuanhua Han > --- > v1 -> v2: > - Reword the subject to make it clear this is a doc fix (Barry) > - Say "VMAs" instead of "pages" and mention shmem VMAs (Barry) > - Fix the From/Signed-off-by mismatch (Barry) > - Drop the test notes (Barry) > v1: https://lore.kernel.org/linux-mm/20261202121419.4026587-1-hanchuanhua@xiaomi.com/ > > Documentation/admin-guide/mm/multigen_lru.rst | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/Documentation/admin-guide/mm/multigen_lru.rst b/Documentation/admin-guide/mm/multigen_lru.rst > index 9cb54b4ff5d9..7c2c6af61fe0 100644 > --- a/Documentation/admin-guide/mm/multigen_lru.rst > +++ b/Documentation/admin-guide/mm/multigen_lru.rst > @@ -122,10 +122,13 @@ the former is the largest and that of the latter is the smallest. > Users can write the following command to ``lru_gen`` to create a new > generation ``max_gen_nr+1``: > > - ``+ memcg_id node_id max_gen_nr [can_swap [force_scan]]`` > + ``+ memcg_id node_id max_gen_nr [swappiness [force_scan]]`` > > -``can_swap`` defaults to the swap setting and, if it is set to ``1``, > -it forces the scan of anon pages when swap is off, and vice versa. > +``swappiness`` overrides the default value in ``/proc/sys/vm/swappiness`` Or could this also be `memcg->swappiness` under cgroup v1? > +and the valid range is [0-200, max]. If it is set to ``0``, the page > +table walk skips anon and shmem VMAs; if it is set to ``max``, it skips > +file VMAs other than shmem; otherwise, it scans both. For any nonzero > +value, anon and shmem VMAs are scanned even when swap is off. It reads a bit odd at first glance. Maybe add a note on why we still need to scan here — e.g. to update the stats? Demotion could also be a case? Thanks, Qi > ``force_scan`` defaults to ``1`` and, if it is set to ``0``, it > employs heuristics to reduce the overhead, which is likely to reduce > the coverage as well.