Message ID | 20231130024528.2178-1-justinjiang@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp116227vqy; Wed, 29 Nov 2023 18:46:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHB7NeWVX7N1yixb+nmMwDjLaQcunvYn6lmZv6F9dPBylsJzqn1jgEL8T/+Di1in1HTs87X X-Received: by 2002:a17:902:e852:b0:1cf:b8bc:12e1 with SMTP id t18-20020a170902e85200b001cfb8bc12e1mr16114210plg.47.1701312379525; Wed, 29 Nov 2023 18:46:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701312379; cv=pass; d=google.com; s=arc-20160816; b=RWRji7+k63YrWUTpc7DFiVVc3qbQW9MPCTFF2PIxnpA/KDicAOKqztRbkSs2jyxXzT KAGhixxpeO+BD4Qt9CCBsFAkSRK2JH7evOZJJTrzJGius+NwJAdjY3W4YO7Y4RS7/4V/ qHWTxdHu/58dbW7T2T3GJB8xQm4tx84BpoRulr5r4zsAXwOA2F/WgxbqK5Vl3enVUetq 0ZXiY+GdbrT2YrDCqcvPgKi5YYsRb+46zZHbOpSbS/DNh3+7rbtTPyh5sgl3cIHO4Iz5 CvBsAHWmqLbEYGgDyuqgIAr7vx7c2mlcDoKFV28SCQ4qN0kssSY5U2wJDy3L1by04U4f 5+kw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=WEQBD5cr2ycjbhXEdl5wbiP60KFmlUctUSQrnqiddJM=; fh=OYMBR59TaleNKPDr2YW0OjewfoWPSWTYfJ5hOJQ1zWM=; b=Xe+h10OkjU6aL5L3JuAxG/+J5ZBg6rnEM4/kKbEk00TjwO7i4/153a8+CA5uDTrU/W Enh8lkeP+0segpkYUJ8SLKHFgcqBzqNEEu6sExpF86B+Ybi3Crmm6Br/L3O7QUpjXIPs 3t/K1vRQW7xJ3w90mxYJrxjfGEk5Muovi2TzjZ1bW5W+lEFzSKiBklSGRO8iSxhzRsZy j/TJJppZ4koMsG5YVRoGvRlWvSJqBSVJ7a9CUuLzo+1ZKSo/CFW8H5+SMFx8mAEozz2S kd4R+hE+vmjHsZ2iMT8O0NdgSQ2QQTbsuZMebXEQ3HY8pRdTF+clkIebgiSczclg/cb1 i7sA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=W8rJzdmq; 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 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n17-20020a170902e55100b001c62b51ac0fsi155039plf.306.2023.11.29.18.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 18:46:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=W8rJzdmq; 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 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 3A75480930E6; Wed, 29 Nov 2023 18:46:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344162AbjK3Cpr (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Wed, 29 Nov 2023 21:45:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbjK3Cpp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 29 Nov 2023 21:45:45 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2104.outbound.protection.outlook.com [40.107.215.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8124A98 for <linux-kernel@vger.kernel.org>; Wed, 29 Nov 2023 18:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ew82PnDCcOFMzi++1imtaWRXjxSFN6hMA++gG799b8PUpQbRhnGdpk+FGMXwkJ+SihW5SIAmOWO+QiT/BqnKxOzOBOS12gPEGJMl6as1yfCWebnvSxgcGn23qW1Y6Vm6LZXj41Gn6QZroPnw7D147C7BONjig7plGB9xspEi2jV21gKXdlKj9y7DhTk4oXQpIobtTRYYNrdw2/N036sTdnZRjRcD9oJDIVhQa7kcf6qJg4rU2t0a5rJ3OVfUCa+bDFcPy7nA6LOc60gm7yj+j/HoFS4QMNJiuc+pAZnpCdumbZfmH1MSGsqNGN1U7vRPjlnetmXJvZ6vhj0xAUphVg== 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=WEQBD5cr2ycjbhXEdl5wbiP60KFmlUctUSQrnqiddJM=; b=cbNpDeCqzaeL6c5mXMN8DRLlNH8CGQNDbiwEw0NG9exj4oS6ZvGzrUqDf50Wc6douRdB9k2LbLAqX9y9TGm3I7xlG27xoatj0V+L0qu+DMic98ocoDN3dWmKZ0iG9nZwRlp1eKQS8fp/Aj+Q5r1zRw+g0cTnmi9BN+YXHjsbs8gnCzpqSXK+73QCNfPAAdksG43VBGifyL9iuzTiioeznbSzTpHPRMdlZ3iYF3ZY6wrD/NN5AGU2ynT/LyoGi6vdYyL6ujQITjKtZNPdN7WLooC4CA4jtj0f6zLcS1BC3IxtgPQaj7fsKR8tE0gIjzKb0DhRDX0bcrw0nfDNEv19vQ== 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=WEQBD5cr2ycjbhXEdl5wbiP60KFmlUctUSQrnqiddJM=; b=W8rJzdmq5S/34MsDHB0IDEXOoAV650JPPYIDpZ2kzZz2AmbO9A61SO2fZexTna+QmwmiILm6o8lzg/tqZEh6kmwwseL0LQZ47JMXcH1d0Wew/N1TbJZhsHdyro4KMxsbUjRHUj6OTyt/d6QaHVT1W3CnT921hxPrsQgxLduNfKj4E9i7XJXsHRRgwQXhvQHEBqr3oQ9mAFNeBkjCOCs/98j59WvLe4C4KrtDw74mlfcustj3/6lh0ukV3Rp4FLBAnBukh9n+6moGCUlodoBvbjIjzvpPRaslpkd/XO3yD79qOuRALeT7ZuZgGjk+TLNMXhckZcdz/1Eyh7gro69SfQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) by SEZPR06MB5000.apcprd06.prod.outlook.com (2603:1096:101:48::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.22; Thu, 30 Nov 2023 02:45:40 +0000 Received: from JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::1be0:ebf0:eb04:6bd3]) by JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::1be0:ebf0:eb04:6bd3%4]) with mapi id 15.20.7046.015; Thu, 30 Nov 2023 02:45:40 +0000 From: Zhiguo Jiang <justinjiang@vivo.com> To: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox <willy@infradead.org>, opensource.kernel@vivo.com, Zhiguo Jiang <justinjiang@vivo.com> Subject: [PATCH] mm:vmscan: fix shrink sc->nr.immediate counter issue Date: Thu, 30 Nov 2023 10:45:28 +0800 Message-ID: <20231130024528.2178-1-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0225.apcprd06.prod.outlook.com (2603:1096:4:68::33) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|SEZPR06MB5000:EE_ X-MS-Office365-Filtering-Correlation-Id: c2b9d5b7-d192-48d1-3adb-08dbf14e707a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pbRz08DLr3hJsIaN5V7q1lf/3x4DPyIF+GeHhOu8tQ+1ll7PxpnCoCYwyc4DYw/WwT+HfmlFo9hBtyFUOAZr7IEIaDm4J36vx6LyKhXtpbSSd81Snn8n+VwaPwoQhaqJn8t6G2HsLNTJVUEnFJAX6XJctLU2uquIBjDGBo9ClAP4PGnPG34Fm1qxYP8VusdoJKqY6GvMKoU9t1MXJxafDT+UQT+pq7Ao81KZi6LZkRMBjU2w2ZS8g6u54YpVviXI0JtT5u9BrhhDszjh8hUQmYljHyurjrVx9L8yVhaFXB52R7dOi4M0d5ivlPaSO3LYN+in+BPNQpWER8n1xkAnRaI2WhlD+VTswxwRoElfcl93COabohphDgKUaqm1TrX35sVZyeH9pNDG4ODiKTmcffni4oSd5VgqjhSJKAB3dJEFY4v93OARuSr4AekRCbGk8AnP76y+qwh69gyjWOweYynj2mDGbEokpsn09EhOkdJ+Wo+n5sBHRyabl3JghkOrHiBPGAPS6zFQabrlLnsWbQbFU7+qylSKkVUG9tmTDY9X1/dINm5IhKVEkeXbj3pwgu4VxPoJiuFm2Tqv1WldU4ero+a8zTWhYC2OU3xXN6zckh/S8M3INBb9F3bOOKy28yDxHTCEFVUJrXPRlu5J4pOdfdXaUy6e/w/b/70+zRv8/yM6CWu4WeciCbY98HKG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:JH0PR06MB6849.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(396003)(366004)(136003)(39860400002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(41300700001)(54906003)(66946007)(66556008)(66476007)(83380400001)(4326008)(38100700002)(8676002)(478600001)(6486002)(2906002)(5660300002)(316002)(8936002)(86362001)(202311291699003)(6666004)(52116002)(6506007)(36756003)(6512007)(2616005)(107886003)(1076003)(26005)(14773004)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZM8jreaXczerq4uugC66HBBLkLuA1FvPEQELS/L0KX1A0xTw/LH61G1/cDHOdtlq104Slybgytpo6uY5EicZgrXG5JL5aGRbx2RYtmUxcTjZcUWucsf493SKf8DN6JNp3zS2gqBeuIf5nzYernePfm6hOTVVscGHx/J5B6+nDGo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f1B76ZmZZvH3IMCZ1Lf210/fIHd17TEtNNEeNhb5IJP96mR53WUr0QHd1QjtEEHr1fD9r56D8EkMMrnf4d3fyi+6RpL3dY+NP5InkPoyacQE4np5J99RbiRFPXLcsQPwYNnUkOjNhMi2ltqOsMGx6TZhn6/Mkj4cMgJmXaYj8LUIRN9nD8E5jdaot8J+23oKb5slyQNL/cBsDziPp7H/RolNv8TjW3B/ZnvAC+tlUiKBpQU2vRE7QxEhCBWwqA+DueEup7jexLutIkN2BosRQSuhXcGFodBIRiYgAnsp+2ov9zpkxqqYvK5o29jkcpCoCp7ZAOPUEVFOkDg0fz/q1ib4qUk4 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2b9d5b7-d192-48d1-3adb-08dbf14e707a X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2023 02:45:40.8363 (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: /QLCMXkFiOCzj2bMpWrFV/jEKLD/mkC9MP+j3SUwqTqrPGmMuQwkbyynZJg3J2Hj25+ErYMMi0upm8gkZOTbYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5000 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 howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 18:46:06 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783955330017675771 X-GMAIL-MSGID: 1783955330017675771 |
Series |
mm:vmscan: fix shrink sc->nr.immediate counter issue
|
|
Commit Message
Zhiguo Jiang
Nov. 30, 2023, 2:45 a.m. UTC
It can't be guaranteed for the PGDAT_WRITEBACK flag that there is only
one type of page marked for immediate reclaim on evictable LRUs in the
following shrink processes of the same kswapd shrink recycling. So for
the siuation that if there are only a small number of pages or even only
one page marked for immediate reclaim on evictable LRUs, and at the same
time there are a large number of pages unmarked for immediate reclaim on
evictable LRUs, kswapd is also throttled, which will increase kswapd
shrink consumption.
It can be fixed to throttle kswapd shrink when sc->nr.immediate is equal
to sc->nr.file_taken. And when there are both pages marked and unmarked
for immediate reclaim on evictable LRUs at the same time, kswapd will be
not throttled, and kswapd will first reclaim pages unmarked for immediate
reclaim on evictable LRUs quickly.
Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
---
mm/vmscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
mode change 100644 => 100755 mm/vmscan.c
diff --git a/mm/vmscan.c b/mm/vmscan.c index d8c3338fee0f..af2b6906171a --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -5919,13 +5919,13 @@ static void shrink_node(pg_data_t *pgdat, struct scan_control *sc) set_bit(PGDAT_DIRTY, &pgdat->flags); /* - * If kswapd scans pages marked for immediate + * If kswapd scans massive pages marked for immediate * reclaim and under writeback (nr_immediate), it * implies that pages are cycling through the LRU * faster than they are written so forcibly stall * until some pages complete writeback. */ - if (sc->nr.immediate) + if (sc->nr.immediate && sc->nr.immediate == sc->nr.file_taken) reclaim_throttle(pgdat, VMSCAN_THROTTLE_WRITEBACK); }