From patchwork Fri Sep 22 04:14:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhiguo Jiang X-Patchwork-Id: 143428 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5564717vqi; Fri, 22 Sep 2023 06:16:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8BGwRxwvqN7vKEl0Gbhiv1YS12AOPoezHhOtkg6zYVf7VreOFfIGHt+j/AKmq5RipCpbv X-Received: by 2002:a17:902:a407:b0:1c0:aa07:1792 with SMTP id p7-20020a170902a40700b001c0aa071792mr7203718plq.36.1695388561424; Fri, 22 Sep 2023 06:16:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695388561; cv=pass; d=google.com; s=arc-20160816; b=acahCuttZF+W3dR3+jfXBQFC7A68u32BmftHiIZFBBua3avLH04mvsna1B3Ewsrmuu OgF6J9wytx7OBXg51p7IBQ7C8ptzNBgQVFjfQk4v1X0qvDYc9xJAjBSXFAZ94ShNOjaT nAc1VC8z6GI0GBcG8E7umdb/WJIkwkQ0DBMpB1bAtPUYT+OW6J4nDDxdCYZMW7Ubg/+n sMAzVEPXhw3i7k1oVtJFlj65NU8B3yCl8iAAyLi48+/AU7dksooMNtJHi6M5XSWyHRFL MlA/vPyBcCYuBbgl5bptiTB7PrHVcUyJgyIZGa4XbJ2GUO2qvbK75qRm+REAv+dfhOih k68g== 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=2t8UNqZ91plZHBALd149ETXAJYAtNkZTNbL5vXPLBpY=; fh=c2eYxmN/YNr2ouhP31X3BrePKjLzNfOQt6lh5667ppQ=; b=RkpQNi20zr9oyck+Re8BSzNSHfnPMJmeXRcDNRjhckHM43YX/6gEKp/tt/TO8zsV0a 8l/VbZgzoQGThpDIK6pCjbGXNN6N2Z7C1oV2hjCNEDX7J7euTC9q5BH0eYb6c6NnwUe9 xA4F9Qm6VnzZ6XeVnO0CwVKtQzZpcGeJwnsg96uQbNw0XhhmuAaO4Y1JiadBL8mVbuWC jiziXahTUhzYIbM1W7H/SmQnUEOa7eHYA8Sa8ELfEAMTuMS2uJmIMXKwTlVI8lP4AVg7 0VgKuPDZ3zXfK0SonDCdkXKuWDyJQiZh7NgYYH05oK9Eg3bPPRyFYpiBHyCOPOXbFCSo MI2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=C3DSxKYt; 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.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id d11-20020a170902c18b00b001c3c94d212fsi3672080pld.97.2023.09.22.06.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 06:16:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=C3DSxKYt; 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.35 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 groat.vger.email (Postfix) with ESMTP id 418168098491; Thu, 21 Sep 2023 21:15:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229801AbjIVEPV (ORCPT + 30 others); Fri, 22 Sep 2023 00:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjIVEPT (ORCPT ); Fri, 22 Sep 2023 00:15:19 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2110.outbound.protection.outlook.com [40.107.117.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7DE5F1 for ; Thu, 21 Sep 2023 21:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l3ppE/YU9+09pTEUkABxreIZxqtQMZHDiEsGMpHtyeDu4RuXJuCkd5U5h0mmXsIjTywqxqznu/b0FKYj+tRvKfEENL14oz21hfGSuCPQkEkg8MaqoOU6LPcF1etsqB8hWHvb9Nw09Jo5zBeW3G7GecSIdKFwGN6OGWiXYHcbAu82CsvwQeCSie+qXJyPRBBEP+ClXSM3ywsAU007Zgg7pVG3NKL4j0mj4nE8JNwSTMaUMXEVUbaISbpn5wYF2MMHbeHCwgmfjtz/MiFxMucyiTNB+p6S/fI7ohT4kwu0OV1lK8pco4mQ1Pgy5hk8fUMdU1GcgYmjnlqqS4q/Cq6C1A== 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=2t8UNqZ91plZHBALd149ETXAJYAtNkZTNbL5vXPLBpY=; b=YDmX8ztWo9pOh6Ao/pOa/Uht4bcJghh3NT6ZFfdceDic67clg4dfR/KjiuqsDQ6oDm4fEvpXNhYf9vUZH/nt//W1l7dDnlbry7it2X+X2TY3/yy5PSraGPpgqojO7mEfW8111QIe3pjBoxZAqq3Nzf7Ou2389jzQxNSbgkxD3slKvQZzbAa4Ho4rMW1zeD5pxyStHQNP2NCWtFcXTX+JymMUxHbO8zlkm5o+Yt6s82pPJZ628bF2Y0tZl0OsFXw/Q4RDLEgRjucqAHpuk511304/eQZfR/90AFvNcurErez0jmGeJnJIwD/gFWIKVvfRUzAmv4eszS/feK50S2t6AQ== 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=2t8UNqZ91plZHBALd149ETXAJYAtNkZTNbL5vXPLBpY=; b=C3DSxKYtN/30YoWp8iwzRs48065vd7RSIfe8p41hihdkPQt2MjxRGgasck/8idwu0KYYJQLg5eR59ItoTnPgAE/Ye+yXFMtv6FyBh21dXN0qlhFjRIX+qJvqBPvPWm7xSpNl98PooMqO74qgIao3JRLSmcI0mazZH3bfrIGXUuPeFjaxQuv8kcO0FLKidY4sVWo5nmP5RzfDMPpOGlDUsTE/KnalbUfvSd7F8Q/IpnXigwChCDMriDJKrQoj0Pg10YwEDq1lRVthb1dcDUK0if90MMePSt1miL4CVyWpUMqMIGLF0kDyLCpOqV2gZUXfaAl6gdbht3xjaFk2z+0bGQ== 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 SEYPR06MB5326.apcprd06.prod.outlook.com (2603:1096:101:6b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.29; Fri, 22 Sep 2023 04:15:09 +0000 Received: from JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::832:19a2:2f83:1cfc]) by JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::832:19a2:2f83:1cfc%4]) with mapi id 15.20.6813.017; Fri, 22 Sep 2023 04:15:09 +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] mm: vmscan: fix the kcompactd order wakeuped by kswapd Date: Fri, 22 Sep 2023 12:14:58 +0800 Message-ID: <20230922041459.122-1-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 X-ClientProxiedBy: TYCP286CA0127.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b6::9) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|SEYPR06MB5326:EE_ X-MS-Office365-Filtering-Correlation-Id: fc2fdce5-b7a0-41b2-47b8-08dbbb228222 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pl34tSMt4BIZp7eCiq87mC3maYGm6ZMzE99vyhHt1vwBVTASUxNgXt8hSmut5ZkpWLY+HMFsRMnApIfNiR7IUfBMWpPHFa8M77kcrNx/Ihuus7AVDC/azhWio1A1WCNiqHGACI68AaEQA+t4x5w4yra6ONvMIzjT1AoQgoVZko5eJIuKu969noLftIZVhcTU/BYzm3oIv9QZRNEyB/EkcwxJt1If09Xat+nNiTlBF9bZam5vMLN/xSbLqYFCzJUqY7qpVDjMK2uvuGk5Duk0F+8hm4ysQZ6/JKvNEH3tBlJ3OmeIboCEZfhCulSftReqNHQrfYOwnBIsZsUz1YDL52u1gXWqJNpEaTh7aCXOFT1TK83WGj/+fznVTdnS5mkVCSPHF/ldbv2iGt9Uyyxbn+1C5hyoPiYt4FxKQAgKBhKQ09liIHojYXwkfNrs8gSSMS0mLfy6N8MJuEm3bS5/BKaxtpV/JX52XzqNTVK9hJ+HphKWpIihb13ZJ4vj/nZbol3QrHo3FcHe8zi0DOp76zkoBlMgbdcA42UaFit+vwbAGbHAeFB7nyBpJ4eTM8HpBFyOvHdz6V+F9Hz5CD2O3gUO8y/pHtQSLsDlC7+q1sIY5oVUwAeCvkUPf0Pa3I3u 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)(136003)(396003)(39860400002)(366004)(376002)(346002)(451199024)(1800799009)(186009)(36756003)(41300700001)(83380400001)(6506007)(6666004)(8676002)(8936002)(4326008)(6486002)(52116002)(1076003)(86362001)(107886003)(26005)(5660300002)(2616005)(6512007)(66946007)(38100700002)(2906002)(38350700002)(478600001)(66476007)(316002)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QQYkZJZ9EF6mexnCbXciUz1ip1MYkANJ4t69icxhLknfrJ9bx2mCsJI/gSnfSPvP49jZo2u7gmauHPw07M568++W5A6OFTkRMjOM0WYgPlV14/p6ISPvFY7SyZEBKm4ue1g9HoB62AfzGk2r7brhGf2vYAmbR4ERv19GMkf1IEMAq2FS+FaBMEBerd7XWTnkYn/9rRGJNxBO88f4GMhFwe7DRY96cSjE33Ya/hL7+U9+wk3M4D0QgoqsLrEnZ1kIdo4nvF73BChIjyd+cbxJe01Y9fCxNJXSqbIN05GcuXdK7OY5O2Gr++KW+Z/W8xZhOMKFyIGrelwBzb209rT6anPzXVM2kBbk4rt466ERFD1RHzJLi7G2iaiNgbb4vagBBWq8P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dyQPPRMcwQBH+O6HmYx+S8//6D0HCY7ok+0UGLT1qpE7Kn3iHQljC6zDa7ZMBe4xqCBsXe/iMH2VgiBTddZ512cbxA5GRX1FMWQd7yL24I5kQdXyWbCj5x/P+ieDK8UYGqktikrqK5Y9eeAGPSR2 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc2fdce5-b7a0-41b2-47b8-08dbbb228222 X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 04:15:09.1599 (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: xlPxjtQ9LJ/0uCu+OXlzppKHJwAED8mlmSyVAAJ4x85+IBAVFVzCQ5YmRsbHU1Vyr2DlQQS5q1yHNPheRxzxew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5326 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 21 Sep 2023 21:15:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777743756257080881 X-GMAIL-MSGID: 1777743756257080881 When kswapd enters sleep, the situation of reclaim_order < alloc_order < pgdat->kswapd_order is possible, so the kcompactd order wakeuped by kswapd should take the max value of reclaim_order, alloc_order and pgdat->kswapd_order. Signed-off-by: Zhiguo Jiang --- mm/vmscan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 mm/vmscan.c diff --git a/mm/vmscan.c b/mm/vmscan.c index 48c092cc6088..95883bbe2d29 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -6955,6 +6955,7 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_o * succeed. */ if (prepare_kswapd_sleep(pgdat, reclaim_order, highest_zoneidx)) { + int kcompactd_order; /* * Compaction records what page blocks it recently failed to * isolate pages from and skips them in the future scanning. @@ -6967,7 +6968,8 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_o * We have freed the memory, now we should compact it to make * allocation of the requested order possible. */ - wakeup_kcompactd(pgdat, alloc_order, highest_zoneidx); + kcompactd_order = max(alloc_order, pgdat->kswapd_order); + wakeup_kcompactd(pgdat, kcompactd_order, highest_zoneidx); remaining = schedule_timeout(HZ/10);