From patchwork Thu Sep 14 14:08:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhiguojiang X-Patchwork-Id: 13385483 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 4DA27EEAA40 for ; Thu, 14 Sep 2023 14:08:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B460A6B02A6; Thu, 14 Sep 2023 10:08:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF5E76B02B8; Thu, 14 Sep 2023 10:08:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 996806B02B9; Thu, 14 Sep 2023 10:08:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8AC696B02A6 for ; Thu, 14 Sep 2023 10:08:45 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6052D805CE for ; Thu, 14 Sep 2023 14:08:45 +0000 (UTC) X-FDA: 81235383810.16.0153274 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2125.outbound.protection.outlook.com [40.107.255.125]) by imf12.hostedemail.com (Postfix) with ESMTP id C300D4000C for ; Thu, 14 Sep 2023 14:08:41 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=TCxMiazL; dmarc=pass (policy=quarantine) header.from=vivo.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf12.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.255.125 as permitted sender) smtp.mailfrom=justinjiang@vivo.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694700522; 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: references:dkim-signature; bh=25gSk+iw+1BRBgn4qPNLDn+HEnsKsvO2/y0kYfraXAs=; b=KCly7c5n4k4RiiHzL7dt94uhXBYlTrXbGvCzWQGxBRB5kH9kbzdX1dLT2GrGKEEIkNHWN6 S2DawtoA27Ync1JLWsIS4bBMHQPXQ489i0NjsJj8xa0UgLI85E9M57GL9znK+7mFg4an/7 rw8YiVKVyp0ljoAi9u7OVOmtap/++5w= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=TCxMiazL; dmarc=pass (policy=quarantine) header.from=vivo.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf12.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.255.125 as permitted sender) smtp.mailfrom=justinjiang@vivo.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1694700522; a=rsa-sha256; cv=pass; b=yDMxjXR+7ZWc8TeVuy423LYc7UL7+ZLnRm9sLo3eBo92frQV6UMSzLx8lrP4trIV8osvx/ SAS+SiJpje9z2MF+Xg5QS4kfGt+gtXMLi5bbEU1Drq8WhqYhGFDpx7SSe6gzRUK2Iqfiid 5UywC5sPYqmdImjIf0hQK6KfIfv8Smg= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QKvzhMlRsXAFxevKhDIG2EPQtLghTWyMb7JggQJpTrTODQ7uo++FL3K+Qym7pQj+V8j38Php/2xVA/4O/UPOCaabZX188tV4EJ0MH3gHwR4mHc9GYfo9xjaEQ25GN0M46PPyk8nt2mI33enKwT8j++xreiLTLxRXisnWYg92iHZWWa3lV8oik96oH0eHIO5toxpKnY4xesso2Sgoe98j1COD7i9xhywXRSLeTOydJK9EqCQkQXg8h7Zeeyj9sq4KXgxrCDskCO1hKKL2IYQl3zrR+Eeq/Xbp0+C/kNRw3dfvYRnDe8b1nGpYKIatq8RoRv7w7Qjylp4GrKqoNwJrBw== 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=25gSk+iw+1BRBgn4qPNLDn+HEnsKsvO2/y0kYfraXAs=; b=FTZHNUuYfK493L3XbRgSznrUbcCrVXju5UFhUasqUCfowQOUulsQLXu+JpPGIGXrQ8RLsfevobxhGCebU2dPo7v6dzpsH95oYAfoA03IcUiG0Cr395A2DWis3f99CQhgyKpGcfQXoPYdjkI0kqIOH/zrg9rfqXH16QQ8GmSz19qcLy3LJ3jzTk5Sl3MC0UFPiFYEs6I/HeOJneCHg/+JoRXjDhzlNziRieE6eJAXvYqaLZa5vLfB9tVjlf9UIwMVklw7U8OFVI5nm4QP7xDpWAryM6L0fka6d8AT4rwjHgIzK4U3hwYHOEthGjAaMx7OsZLWMzDee/PtBqsuEeP1yg== 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=25gSk+iw+1BRBgn4qPNLDn+HEnsKsvO2/y0kYfraXAs=; b=TCxMiazLSwCcWJymBqs4a+bGCzJiHWMBG8RG8BpUdfV5itBOVvd6udWbbm9RQNQfPgElzErfdQ73uKqkH/pnSg0Q5SbB5k0+7WHbQGbE63H11l86lMROtoNLJxno7KzZA/7yhaHO4pu31liWl2Rf5PmO28P7N7oXtvTK5SlMqxOfmveb6h9rSmu4okeL/d8ZK3dNIaA4JkG9winYIehWjbslg1+VOQFHNSVGjn6yb1r8S6hItmDH1HQpZo7eVGqQAyaLNolbp/OSMkwT+1lo7PC5CBAE+UPScBWLFshz6rXHQw3lHLM/XpQg6JZPjggca4Xn0a5aV6VuTuwdqBwMxA== Received: from JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) by SEYPR06MB6756.apcprd06.prod.outlook.com (2603:1096:101:165::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.20; Thu, 14 Sep 2023 14:08:33 +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.6768.029; Thu, 14 Sep 2023 14:08:33 +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: mglru: fix add unevictable folio to lruvec->lists Date: Thu, 14 Sep 2023 22:08:23 +0800 Message-ID: <20230914140823.1732-1-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 X-ClientProxiedBy: SG2PR04CA0192.apcprd04.prod.outlook.com (2603:1096:4:14::30) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|SEYPR06MB6756:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b61d915-9312-46bc-ce4e-08dbb52c14b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8lzgS1LOC1h6CMRorgt3n+PRsesPE1ErOq4DnDDErbNYzCIXp/hZJswJxyTe7Xp4hm2XJ/Ss74xn36zuqNb0RmnxnmLdoB/zgSRwHC0YefyblErzlJt+dv65aO50nFkKDpLCGTKBmNt9YYrynWajdzel1RBJsTf2w8wQFoQFlqDP6cnH1qHcgEOtSDwP2omzYigv+gp3IAqOZIE5A2gOUYZOZWsn4WzvW0Ec0kr8ePRSlUPmS0FX1hJzYeXOeevDWCIkZ05iglvDrM8WOh92G8x1qiXGjfPax2hNVnWN8Ta5Vbxn8pMz8XUV7fnBGY4aEyWvSLnJuRJ13RQnlCJ7UD8nfYCEe3ZIBFkXZTXfiuv4BQp2bM9ZhFEXj9UFgxEH4eg0mFe3Xn7xnide9okdQ8ZeGTAvUQnlDfa8577RvqH68x39HXOI74L2yHIgdXO6Zr4e/OvoVj+fSQInA8SW5YDXrW/I/890w48Hto+WlfSavhrw8VTA9588kF0HCiIeP1sEhQIhE0ZR1ksyQfdXBcILQeviEkDChee3EzjF+PQS1QnmFkuvXkVATMbvnxz3yOszOtg2vmwGnN8vtJnUsQZVGxNYPr7jJWqY+t0gKfuXpLkKhVzx67qwCp5YvEF5 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)(136003)(366004)(346002)(39860400002)(396003)(451199024)(186009)(1800799009)(6506007)(6666004)(52116002)(6486002)(83380400001)(38350700002)(36756003)(86362001)(38100700002)(107886003)(4744005)(6512007)(478600001)(4326008)(316002)(2906002)(1076003)(8676002)(8936002)(5660300002)(41300700001)(66476007)(2616005)(66556008)(66946007)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: L4q5a0S94vZDOxVAf7qbyxHT1KySif3zxr0RXtvaUxsSxqK5F00vY6bdPToGixQIDG+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OVIToTRjJnPkasB75SI2WBjChzersvkDCsW3wH8mDFIU6hvPAYKQuZ4ZxjKZc9PUUENhtQJ9Z0RA2nlyV3JuTO9O3h/ifJUXCvQZ5CRsydg6Z4h1/9V3CsCmBQ22SUZIL9h0zbxycAv/ggyJmAsrxUYZeSMheZlr/FjsPfWzUjoMWK9ueYZN/3RwJekuypsMmF63rH91iMnnA/XgiRkqaN/KljuGzQdCyXeVI5Q0S2A9QhkY2EC36YZI1wfxJnwbp8k8xUo83JtCBZ8Gy+kuT2gKRxrZSX4lNc1VFo1ZSdhBjKa0FOJvpzrqxcCXUtC2ee5tcPNu2XLR3oBZ0tdwFgYJQBf8SEcnwhIou8j+duRbSNswcHlehHVwuKM9s/24AVwf4TMBtWBYCT55CjBRgWGuO/olm5uvyC3+9Dn7beMU1XS6bhtUC/r17/dUflKz/v/9H3C2G/yJp X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b61d915-9312-46bc-ce4e-08dbb52c14b7 X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2023 14:08:33.6571 (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: q3YDhQb/3F3srSh5Yh2s4y1C3fzpAZJRJY7VYxvCA9wr+tdqm/EcakMeV3v907SZrIqyKaOay8glmvVmpI8KeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6756 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C300D4000C X-Stat-Signature: p95m8e6xrzsi63gcn33f9xof5798ccfp X-HE-Tag: 1694700521-178511 X-HE-Meta: U2FsdGVkX18y8U+a/q9spY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tkrnIdU2Y69IT9zlS2MX6L0wDgcrxNVb4+zXB7FbeJLHg0jif/ae9O4cKYR2Vj/dPD5+u72E57RzWaEnKbD9h0BB5KhLB4whORUeUA24DYcrENiXqeb2Oh7NLCCezTerncgV/nHZLPkA2Z2crCMXby8DGRHBiQx+OvauRJGDrHXaSHzdhXfnJhuJYM3koIG81cROl+vUNqDP79giE8412BO5CIWVD2g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.048341, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The unevictable folio is not supported to add to lruvec->lists in lruvec_add_folio(). So use lruvec_add_folio_tail() instead of lruvec_add_folio() to add unevictable folio to lruvec->lists in sort_folio(). Signed-off-by: Zhiguo Jiang --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 mm/vmscan.c diff --git a/mm/vmscan.c b/mm/vmscan.c index 661615fa709b..a15e45632034 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4237,7 +4237,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c success = lru_gen_del_folio(lruvec, folio, true); VM_WARN_ON_ONCE_FOLIO(!success, folio); folio_set_unevictable(folio); - lruvec_add_folio(lruvec, folio); + lruvec_add_folio_tail(lruvec, folio); __count_vm_events(UNEVICTABLE_PGCULLED, delta); return true; }