From patchwork Thu Oct 19 13:14:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhiguojiang X-Patchwork-Id: 13429161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95BFDCDB482 for ; Thu, 19 Oct 2023 13:15:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EC128D01A3; Thu, 19 Oct 2023 09:15:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 073348D0019; Thu, 19 Oct 2023 09:15:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E093A8D01A3; Thu, 19 Oct 2023 09:15:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CB6E28D0019 for ; Thu, 19 Oct 2023 09:15:13 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 99ED91A0494 for ; Thu, 19 Oct 2023 13:15:13 +0000 (UTC) X-FDA: 81362256906.14.F8FE84E Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2099.outbound.protection.outlook.com [40.107.255.99]) by imf27.hostedemail.com (Postfix) with ESMTP id C010E4000E for ; Thu, 19 Oct 2023 13:15:10 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=E4OhPqtB; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.255.99 as permitted sender) smtp.mailfrom=justinjiang@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697721310; 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=G+W6fmJ72ArZzY33LmCyBv0xsV450yR0iejgRMpA4iw=; b=IPKkbtJtml8jY6fmTjLE83JAJM6A/fsD4+MGaY7p3aeunlu1dXG2mTs9QTDTrvoc0z44KJ CCWHyjYM7PJkYo3gzkTZ7t8IP7MtrLWdbVFmJpBkqHie6AjcYWZoRUGKYg9yAWdIsk5rt4 GO5IzJTU6LFqmLhmICsygaeEJ1sVp+c= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1697721310; a=rsa-sha256; cv=pass; b=HbUTrR68EKpN9AX7vrlE1vtjD+u0jBX6FwEo70I2uZvlOKiSDeTh9UkdKCH0SoiwCidJOi 2vBX6rzau2tdNnR9FwFvEPszbX2sGzQtOzA3CsWavjG3eJ18LTxq0XMTgWFYvk7fMapWUv T7mr9dFL90Ja1ALm4w3eJNbbYBIBbj8= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=E4OhPqtB; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.255.99 as permitted sender) smtp.mailfrom=justinjiang@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HVgxGL0IfKP5BsYpz2xx1YpLeAnl8FYLpbrfNP0ul8fUVvSArm/xcxGWsJpIIii4IKJa1Z2abtEFmtLz+o0A00z0cG8NViZJ8a0ruMD7cHZ8rTKAsN5MNCLIZ/z5wQZW4qThprcLx4eghi8TWeGChYwW/oKN3cBxewoOI9Js+lMKHFHknsSxRWYTNPgMUdr3q7VC2COjROEfrCF1315Ce6CKwL/tPNkNXY0aVsKI14ziAhKop2MiuinJaz+d72N08FfETO7H0kreImGCyiiuJsxUO4cYa+gIp1kJCLHqHF7pKTxkRZFS9tJQMh09ut6s3m+CnkwDehIiaE2SOF5C7w== 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=G+W6fmJ72ArZzY33LmCyBv0xsV450yR0iejgRMpA4iw=; b=WzlWUazOM12osh5dZOY1RC/azrBGdAVdhRuIQpmW5opup2SmM71J+JE8sv2F3aMC2oLwkhlA1ZFhgnAaJVxFzkCoNIYI7obxGwbMTePralZ7I7SpyHswxjNuoVv1b5cAFtZQCsCyrR/UOkF7qzeA29u4/HlMDBU83cxfiTyqlb+S5RTVw3QBeaHlJhoPM/f0gW+eF16jyJtGJEBpC/31o+itSYwwkx4PNDUid3XTf/eaNvRbHEpULb0wVpDZQ1ovcv8bpcw35WnFK64AyY3VOBeMeYoB1sIKKF7VwdaJtaifZzUL1Ztns+nyfKgG2G+y8CAMgNHDMm2m37WBTp4ZoA== 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=G+W6fmJ72ArZzY33LmCyBv0xsV450yR0iejgRMpA4iw=; b=E4OhPqtByr1T51mLLXH1xZ2x4OsE9PvykU4CF8skgj9maG53gv+7ef8uTutyME6CtW6cmhJqr9iLts5hv5rjEF79NoKMMRhDPsW8Sl3H7CDEtQt1cvoC9MNm8OC1TKdFjC/pYpM35N9XXlCm56dhhLaiKOFLaHjSwRPNuJXSszJKSk/e5H+qQMW3e42Vd6E9jVPMtRCzON3O0YMT2ixWLFLQh9S47aWctrH2j2vARYcdAknViRH+iKdQH8h8KMoGfR2TS/Bicw7tFQJBqPqpQuCZCOmsyxCuDtsKIfOrdzJ9i2d2fkbqbpAZxjIC0/zG9NgFOhk2GW1nlbDNEz++hg== Received: from JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) by PSAPR06MB4470.apcprd06.prod.outlook.com (2603:1096:301:86::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Thu, 19 Oct 2023 13:15:00 +0000 Received: from JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::32d4:1209:6b36:86e5]) by JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::32d4:1209:6b36:86e5%7]) with mapi id 15.20.6907.025; Thu, 19 Oct 2023 13:15:00 +0000 From: Zhiguo Jiang To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Zhiguo Jiang Subject: [PATCH v2 2/2] mm:vmscan: the ref clean dirty folio skip unmap Date: Thu, 19 Oct 2023 21:14:46 +0800 Message-ID: <20231019131446.317-3-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 In-Reply-To: <20231019131446.317-1-justinjiang@vivo.com> References: <20231019131446.317-1-justinjiang@vivo.com> X-ClientProxiedBy: SG2PR06CA0252.apcprd06.prod.outlook.com (2603:1096:4:ac::36) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|PSAPR06MB4470:EE_ X-MS-Office365-Filtering-Correlation-Id: b9920517-d3fc-42d2-a33d-08dbd0a5661a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nQhOuWlQ0oT2Q+AJCAaqD8oJwWDSLRd3fyAgqfst0sOxPMFYT/Kt7xColcxu5dlcm0LWd0Jk4M5qxnCxMgEB0DhQiC4RKIXQsIEbXPCcfztnCJPnoBOms4QevXO8c2C0nEwDWJCMGdSwmpQ+k1NGk69HmYjBQroJ48R5/Nz0CZmqsrXL3NT2tKDlncaYA232VWDDAn04yPou9HMs+ygM3ohFxRJFJ+QbuRW4I40JiV1YrolXdLGTAOQAej1RoymHfjWvQKnXPKXS1CeKJg2vXXzCVXI3VJTj6gX52RCmCS43ZWx3YlrZs5+RINKoVPQyRN/sj5xSh4DR1HeWsOwC9bhgensyOQIWVS4ZJycUigsel1HFModobdiz94+zQy0poMHI3uhxxxIdmIUdLWX7KbEZa+LKHahmScwDo4aDnHHM8uE2/SG4HfcYWccY8K70idBWcZ7runSiCvsLsdPs6gLDzXB/EG6MuttqQvtjzaOMNqK2Efqc3Fpr85NLfgtFXTJv50LvGchLDmME23ZzWEO3yU5fEUSO5K8j1g7pjOAdshCDlb11CrpaV4htI/dmB2hgNquAMor5n4hSc0/fb8DWJAzEm8BS1Gc10c9OhTiojyaz2p8vH+UT+OEM4jWhQFwOUlRrtIBKX9cbKChnuw== 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)(376002)(39850400004)(136003)(366004)(396003)(346002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(6666004)(2906002)(52116002)(6506007)(6486002)(478600001)(4744005)(41300700001)(4326008)(8676002)(8936002)(5660300002)(66476007)(66556008)(66946007)(316002)(83380400001)(36756003)(26005)(38350700005)(1076003)(6512007)(107886003)(38100700002)(2616005)(86362001)(14143004);DIR:OUT;SFP:1102; X-MS-Exchange-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a3tLe7hZfwY4ztOxraW7Tl9upiUuPY8FRYdQdhiUkJZOj8dsni0MZfTOZ+5n47MfK9v2om3VV7PAuRF6iQwCW7T+c7cw6fHwT1wZIXceeO8QIVhdgThksNy7WkjlcZYVDRIUtHzOrxJhGDqK+jkekNnh/KXQcCoiSs0JBNq8vlZB0dhD5rwKY0j7S0I+gUgjm4W3UOVt0lWKojbAkjS/3ow0zseB6mO5xT31sSXMvPS4KPn+I0uBGDPyjGUzJkURHQj0cesKea/KnkgMhzqvCUeCCcjyPZrw9F0RP5OL6ms7I4MTjlTAr6M8qU6YCrxUUFoTvdMFduJFSuNDZo9z1/DLHIVBp8u7OyrTJJtN8ITiOv8T2DWsi98NN++XvsKG8+qbOPrr8XzRB42x8IZFMSgl8WBNzi8xNDsO8bdaXqgr6RciqP8Ci5TBiIAERdcOCY99tf9pgj46N8POj2ZFT8H2ljWHHpTig1/sxAltp3lFCKDyyoAQrsWE1eU1nSgKfh2uClDfqy17DH5NYOBC+SZW0RwekYLKUndvFnN3TYz0Y0HwXQUvybrrCfPaWeXk6ueccEu X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9920517-d3fc-42d2-a33d-08dbd0a5661a X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 13:15:00.5695 (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: beufrBEs7jxiCr+SCX/viJVePdCXPh5heSnT22NZQ+jQzxwrvJLsGgqAIJtdbk0hJ0S1sK+8zcutFnd0Fv3OGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAPR06MB4470 X-Stat-Signature: uetc88f45ity77ed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IUwHLC znhRY01aVm6FeMKV8XgzfgIYVhK/ZTjni6tjAs+Hr/BPV1pOP6LV8GHPMzrgLZHLLlJMDkCZkWPbPu49J2iurH7XrgpmOt1hfoZLaq6GumsewDUJF0ocv/Ev3VfntynA7bdzhzQcsVnKqjqavGSDUXv78Ddtr3w8Cdfje8/WqlliiATJeq9db1d061QcuhRdjlQZC0Ostw9edybER7lK/5rwG0hSj5xstvro/uBcETDUb3uoEx25kBXdBEy5Xbpqvz9sbTtmjQRV7GApFp/kuTTTbQAaXc2wRjTFjpFloKGRl5SBK7ggUNGd6KRGfKZYvwahvbgtXwWqlinfoy54vHxHDLkl2PiQ9iYk5EVnZu7jxYSQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.017999, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: If the dirty folio in folio_list which is inactive file lru is FOLIOREF_RECLAIM_CLEAN, the dirty folio can skip unmap in advance to reduce recyling time. Signed-off-by: Zhiguo Jiang --- Changelog: v1->v2: 1. The dirty folio in folio_list wich FOLIOREF_RECLAIM_CLEAN skip unmap in advance. mm/vmscan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index e067269275a5..e587dafeef94 100755 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1225,7 +1225,10 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, stat->nr_ref_keep += nr_pages; goto keep_locked; case FOLIOREF_RECLAIM: + break; case FOLIOREF_RECLAIM_CLEAN: + if (dirty) + goto activate_locked; ; /* try to reclaim the folio below */ }