Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5040453rdb; Tue, 12 Dec 2023 17:58:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKc3Q3qiDej4IQ9PXq6pXcDU6+0lgUVBSVRVC1xUdUPfnC0eLyy55UEKAFrocFYFXr/wFf X-Received: by 2002:a05:6a20:3b88:b0:191:b246:bcb8 with SMTP id b8-20020a056a203b8800b00191b246bcb8mr734057pzh.58.1702432735091; Tue, 12 Dec 2023 17:58:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702432735; cv=pass; d=google.com; s=arc-20160816; b=0CiYz2tE/ghsu8cCBWfOXyLvVBXXlQLbwY0wU6aAlQ9Hvn0Um8+FtDbyNUyHrqpWPx G7HbOeHVkhZzf3VPfPqjgw+I38eEvDPibVzBo8mazHqyt8n6n5Nsdgp3qGixkxxYfZwi OjFLSVzpZkdypNGBfLGm+fcYasHnBan0vgOIsjz7k0S0VwpuF29I6IJr0cwzjzJrSPHJ JSavhVwhUSbcDbG5Fv6fIfhuZQIkcMW93MEbvhq9iqypzDfTDjfZC692G5FaT2bZYUBF H+u2P6ZVq7n3wt3dmHxhes6gtFsI2HwWqHpi9rpcilwPS67KzSduQhB0OV3oKIbX6OIk KZSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:subject:user-agent:date :message-id:dkim-signature; bh=nnuD6vvpDO0TghFg1wH9FoZiAc95vN0a8uFinFOMLV4=; fh=wLAXbdVTMboZlAvwg4G1sCwYNSsGMd24cGrBSetW3hQ=; b=rZnmue8CY4myww/iJesha4VJSwHsYZULSYH/fwsxpTZJcbtILbVCZExQIN68xp4qqb tOhxatYKJU2gkWmYIteYRRTsuPEH/ux+S+bxYdtvamIQxS8CCtmlGOZzmHiuIWvpJVrL KfxuYk1cZWa0PSXMWralF+ra3SpeaO19QQVn2JiHtI8Te/uTIfa/JJBX4Q3Jt/22d6// 8WVRKlIYEceNGO8+Qrf98FN6ENEJNjfCLCOdE4hNpkM3V+DVW50hdb53241oZZNXObFN +BmULvXzxwKsmhsfIXGAqXBWYMe+QiMkCBI0cyF6kDuPeURjLH0gUSPhImCc7rorBC28 mlLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=CJ6kv5A4; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id r77-20020a632b50000000b005c66b0c9dd7si8679697pgr.786.2023.12.12.17.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 17:58:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=CJ6kv5A4; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6D7A2805A58F; Tue, 12 Dec 2023 17:58:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232096AbjLMB6j (ORCPT + 99 others); Tue, 12 Dec 2023 20:58:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232805AbjLMB6i (ORCPT ); Tue, 12 Dec 2023 20:58:38 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2123.outbound.protection.outlook.com [40.107.215.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A106BBC; Tue, 12 Dec 2023 17:58:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ndh5Gl1WcMLjhvFN7DjuRYi98Ae1/hDtwsHeScBm+VRszK7Alf4EWqotuxzuDMTrfAS+oMsmCyvOf+GwGpug6E/i8TFFaIYpzvyoNYtQDAFG4Yqz5jQPCQGj/LmSwMDgjM67eu0/IUHnZwZcCaGCykO8mMGZJe4PR4oLbAMf0SQhzhuCf7kY4ExPwzn5eFI/5QzZEuHoLQ2Be2eJ/ML5ymN6kvp9uuJilxqNMJaiM+dYAmv8wPzNgDNP0LOKeDRJJyL52EBJdxpyow4TBzkSq/8L7cSXE83t1V84pOWl6zq8K0N625DxvzG7J8bP1kE4g+QZJ3YfoozvZa/6w3NamQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nnuD6vvpDO0TghFg1wH9FoZiAc95vN0a8uFinFOMLV4=; b=ArR5e5bjt10+o2adRuOfsRbD+HIR5geDRKLzGiwyyJQRN7PuKVuGVkLU1hcG9iuzoA95wAUNd6+77lkeQsxLFqZQw5D3DjJP1ctOJJQsEDlHOT0aVMhZU28cQyXl5/fgUSwwNZLTJgWApGOlAOEjEbkDM+RBInNYlVKJz3SWKLYAoaW2Vho57Uf/YyctV2kbI1mKYo/1yjiXsCiAYuTYRGFswjT7+ddXLuuJlz8VOkB5rJJ9oHzHZT5Svc9apl3nJh2Kl7lFXC4vcGfxyp4PKFDxQFCiXW5E+uq6SfBp/6oIWM0VMMj06otTB6B+hG7CVeAOXBdx+tYzPVL5Sz9DQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nnuD6vvpDO0TghFg1wH9FoZiAc95vN0a8uFinFOMLV4=; b=CJ6kv5A4sQ8O3IbwTpb2azqxC1IVEqWJEh8Gv3aW3+trwKPfpYxZIePmI9yWiZA0wCUqMrDWv+6nmhSUML3fGoXO71IMAt8YbZKgBcxpyMuBChiD7h+id4L+wn23Djtq2bYwThW7fN/0m4mrS36N14Y5/KagER+A9cGiHTOj+z7JOVjCsK1driRcC99admKqn92luwdZsikyCykgEtpGoBeOapngR7bngtBRVXu2rvwxD/wzCojJRrhwe342dXUuaJpKkLyiPx4liLdl2MBEhc89zxuED8yiqxIJFfJBtrpKOMiuX1nmQOP9qothAp4kc8I3uYb16VeH0G4fI4iAtQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PUZPR06MB5676.apcprd06.prod.outlook.com (2603:1096:301:f8::10) by JH0PR06MB6655.apcprd06.prod.outlook.com (2603:1096:990:3d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 01:58:36 +0000 Received: from PUZPR06MB5676.apcprd06.prod.outlook.com ([fe80::d754:7b3:dc4c:6b48]) by PUZPR06MB5676.apcprd06.prod.outlook.com ([fe80::d754:7b3:dc4c:6b48%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 01:58:36 +0000 Message-ID: <86984d9b-c955-4b06-9097-2a757b1bacfe@vivo.com> Date: Wed, 13 Dec 2023 09:58:26 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V4 1/2] mm: add defines for min/max swappiness To: Dan Schatzberg , Johannes Weiner , Roman Gushchin , Yosry Ahmed , Huan Yang Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Tejun Heo , Zefan Li , Jonathan Corbet , Michal Hocko , Shakeel Butt , Muchun Song , Andrew Morton , David Hildenbrand , Matthew Wilcox , Chris Li , Kefeng Wang , Yue Zhao , Hugh Dickins References: <20231213013807.897742-1-schatzberg.dan@gmail.com> <20231213013807.897742-2-schatzberg.dan@gmail.com> From: Huan Yang <11133793@vivo.com> In-Reply-To: <20231213013807.897742-2-schatzberg.dan@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI1PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:1f7::20) To PUZPR06MB5676.apcprd06.prod.outlook.com (2603:1096:301:f8::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PUZPR06MB5676:EE_|JH0PR06MB6655:EE_ X-MS-Office365-Filtering-Correlation-Id: 85b85bfb-1f23-41d0-7bd4-08dbfb7f0472 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cMVyrlBw+570TONArruBa7DzP3dJyVCV7Z3r5vivnDhIWQJQS/DozFF+SQRr49qiZxNi0dfauv6db+uSxR168fZnNmFxGSJ9TzcpxMZ08MgoqtHI4kiNtxU9ZymOrWxNUY49YlMfO8NJqRLGn8mLUNBNXLzLQLZK+3H4r7+uqBFxMgyNBUlOjQvXi5Ue7LlEy+jkUFZT49uLrQrIJc4Jt05pk0dmIY8+RrRWNWsgotDsVl+TAJTnsl6Rjm+diVqZJGI1no6QL4ppSHPgvFFXnlvs5Go/J3q968QYe5F161d8eUtYXK/A5pY1a9O8m21Z0+QZ6kbS+ik28dsvoh1+Z9k8mcrjm2/H+hf+Sdra4nKBq2PPTTFqE+JXLIRpCtegjxquzS/oWRQqoApl7ezGjTfa35nE424UWBFAboBlKSSubmw+2MMx+mK1Bbw+18W47NCQQSSplmwTC3fYriE3cHxC7hZANYgJtsUHCt6RYtLkygsvBSKxoJ5m+k3LUp+qrTxlRj/dRMqsZ078WNFoONwX3SoRXnX2KhugMmpt27tyuj7dxHkTGgpXFOgrbT0ER3g36brvCvaZYoSJcF+uMFgV1kRlAK0EiRnu7W6cs0+iowij0wWsfthjx8OH3PcuXbSYcT92nRz1lTT+SkoyJtDgS4xSPgwQYPfdkY1lKbXEMEliOB9ewpLRjHEjN4OhqnVbhWrmZ4EAr5nnDoRmeGunNVdWW1gX6KTBOtwnQJF1ZmBYjSmQN24PYJ+KqR7t X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR06MB5676.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(136003)(376002)(346002)(39860400002)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(2616005)(26005)(6512007)(6506007)(6666004)(52116002)(83380400001)(7416002)(4326008)(5660300002)(8936002)(8676002)(41300700001)(2906002)(478600001)(110136005)(966005)(6486002)(66556008)(66946007)(54906003)(316002)(6636002)(66476007)(38100700002)(31696002)(36756003)(38350700005)(31686004)(45980500001)(43740500002)(81742002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b1hDR0svSHNBWnlTRXF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nZn?= =?utf-8?B?dEhCbGFmZmVoaDNRZFBxK29iend2UFBPd212WTBIb3hESzdNVk9Cd1dWTEtY?= =?utf-8?B?L1pNRGhZOXVTS0QxbTVjNjBBaWJWRkZtdXJhU0Q1aWRkbUVaQXd0V2cvai9X?= =?utf-8?B?VGZ6Vy9tQjFabmN5RTM2enhaQmk3QmxrMGYyalRRa1BZeHlLWTF2TktvNisz?= =?utf-8?B?SFp3NWErQXVzRXBTSUZZYmE2ZWc4RDhJbmlVSGlmYlh5aE1ySmlDQlpvY1d4?= =?utf-8?B?VlJvTktHRG5adVFqNnFiYWxnYjEvQk1LYVZsL3FoL09VMHJMNlJ6bk1RbEEz?= =?utf-8?Q?bbS02joSerUIp6lP9UQ6Jwq9B?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85b85bfb-1f23-41d0-7bd4-08dbfb7f0472 X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5676.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 01:58:36.1383 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: O5gZHgk7FUxWBvOcMHKIWwplh59J7T4zZy5/jvoP+BP+ajLIPqZuIPQfo5cFmkhCzsTK92xH8TdQxjUt774woQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6655 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Dec 2023 17:58:52 -0800 (PST) 在 2023/12/13 9:38, Dan Schatzberg 写道: > [????????? schatzberg.dan@gmail.com ????????? https://aka.ms/LearnAboutSenderIdentification,????????????] > > We use the constants 0 and 200 in a few places in the mm code when > referring to the min and max swappiness. This patch adds MIN_SWAPPINESS > and MAX_SWAPPINESS #defines to improve clarity. There are no functional > changes. > > Signed-off-by: Dan Schatzberg > --- > include/linux/swap.h | 2 ++ > mm/memcontrol.c | 2 +- > mm/vmscan.c | 10 +++++----- > 3 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/include/linux/swap.h b/include/linux/swap.h > index f6dd6575b905..e2ab76c25b4a 100644 > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -407,6 +407,8 @@ extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, > > #define MEMCG_RECLAIM_MAY_SWAP (1 << 1) > #define MEMCG_RECLAIM_PROACTIVE (1 << 2) > +#define MIN_SWAPPINESS 0 > +#define MAX_SWAPPINESS 200 Do MAX_SWAPPINESS apply for all swapppiness? If so, maybe better change swappiness sysctl define: ``` sysctl.c: {         .procname    = "swappiness",         .data        = &vm_swappiness,         .maxlen        = sizeof(vm_swappiness),         .mode        = 0644,         .proc_handler    = proc_dointvec_minmax,         .extra1        = SYSCTL_ZERO,         .extra2        = SYSCTL_TWO_HUNDRED,     }, ``` Here hard code swappiness in [0, 200], and now add a new define. And many other code hard reference 200 into max value of swappiness, like: ``` memcontrol.c: static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,                        struct cftype *cft, u64 val) {     struct mem_cgroup *memcg = mem_cgroup_from_css(css);     if (val > 200)         return -EINVAL;     if (!mem_cgroup_is_root(memcg))         memcg->swappiness = val;     else         vm_swappiness = val;     return 0; } vmscan.c: /*  * From 0 .. 200.  Higher means more swappy.  */ int vm_swappiness = 60; ``` > extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg, > unsigned long nr_pages, > gfp_t gfp_mask, > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 1c1061df9cd1..9748a6b88bb8 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -4337,7 +4337,7 @@ static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css, > { > struct mem_cgroup *memcg = mem_cgroup_from_css(css); > > - if (val > 200) > + if (val > MAX_SWAPPINESS) > return -EINVAL; > > if (!mem_cgroup_is_root(memcg)) > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 506f8220c5fe..2aa671fe938b 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -2403,7 +2403,7 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, > ap = swappiness * (total_cost + 1); > ap /= anon_cost + 1; > > - fp = (200 - swappiness) * (total_cost + 1); > + fp = (MAX_SWAPPINESS - swappiness) * (total_cost + 1); > fp /= file_cost + 1; > > fraction[0] = ap; > @@ -4400,7 +4400,7 @@ static int get_type_to_scan(struct lruvec *lruvec, int swappiness, int *tier_idx > { > int type, tier; > struct ctrl_pos sp, pv; > - int gain[ANON_AND_FILE] = { swappiness, 200 - swappiness }; > + int gain[ANON_AND_FILE] = { swappiness, MAX_SWAPPINESS - swappiness }; > > /* > * Compare the first tier of anon with that of file to determine which > @@ -4444,7 +4444,7 @@ static int isolate_folios(struct lruvec *lruvec, struct scan_control *sc, int sw > type = LRU_GEN_ANON; > else if (swappiness == 1) > type = LRU_GEN_FILE; > - else if (swappiness == 200) > + else if (swappiness == MAX_SWAPPINESS) > type = LRU_GEN_ANON; > else > type = get_type_to_scan(lruvec, swappiness, &tier); > @@ -5368,9 +5368,9 @@ static int run_cmd(char cmd, int memcg_id, int nid, unsigned long seq, > > lruvec = get_lruvec(memcg, nid); > > - if (swappiness < 0) > + if (swappiness < MIN_SWAPPINESS) > swappiness = get_swappiness(lruvec, sc); > - else if (swappiness > 200) > + else if (swappiness > MAX_SWAPPINESS) > goto done; > > switch (cmd) { > -- > 2.34.1 >