Message ID | 20231025154432.314-1-justinjiang@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6359:6b8b:b0:164:83eb:24d7 with SMTP id ta11csp2750560rwb; Wed, 25 Oct 2023 08:45:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0V57fEh4e0VGUrlHnKaezYN3bXtP2KgM1zUqUv5G4O4GxY82wTqcxYk1R0TFeJG3m5BTt X-Received: by 2002:a17:907:1b0c:b0:9b2:955a:e375 with SMTP id mp12-20020a1709071b0c00b009b2955ae375mr14968262ejc.23.1698248706442; Wed, 25 Oct 2023 08:45:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698248706; cv=pass; d=google.com; s=arc-20160816; b=IgMlfF21TG3k46KBCK2wF9ORUmSDCvrGeOMyQVDhLU/F173HlRACtitVCkX+cUljg7 +iLeagFb+yDVYSE6xU36V6EJq78xy0BwQp8W8bSfgdwS8qEtb0ZiejF1EYef2OPfVFZs 1z+GNcrDjbTAeokx8N/qUGPsbFwfRteZ3pw05d6N6bJHz4gV/yPTGPFVoLt7kn+8zo+G CxlH2pJ8NLFVCybqyp7tfsUZADcHyM9IOU6ZuP75YXWmN6WquTnL4KN7RfHoltqqc4hf ii8N3NytIHRhHoZDe9Yng5t5kUd3MLwIOPu0g3Pd4auDDJPRWg8XEr6aKkAoqpLW9vsf ivow== 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=JvsArkRNo1ef55npLUNg2F+7XfUqN03zzLzjQnKI1+I=; fh=c2eYxmN/YNr2ouhP31X3BrePKjLzNfOQt6lh5667ppQ=; b=iTRfjZpvPc3XqTQhCh/69SpYa90zyWM9DjHCcSrbzhsoYYPRsKzLkmV+G3bmR+n1Se HjBDOvAeopQMTKjc+VDPnjPg0TPdR9c6e01w6XWMGEHkMohFJiDyk7swUWPjVrmjEFjr IHxNrEiHHV3g/Hvw+WjEEeKLIZ+kvIvCEZUCrBcm53oQA+8wwuPkQgf6HXE7xyI4zwgm XsxTvLeDDGy5xXINIl3+p12b35kbvc3wSQm93TZ+xQLEwhtCEWJBNlEp4Su0XITLGkV2 iNkyTatfn5gBWLPp8MaVmFFuwbpkn7awGAmzdE25ITwkHeOeJeKe5dbqORRapLwWBkRV 3PHw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="hQ/GRUSx"; 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 w2-20020a170906130200b009c74d107771si5949545ejb.510.2023.10.25.08.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 08:45:06 -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="hQ/GRUSx"; 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 4B49D802F66F; Wed, 25 Oct 2023 08:45:02 -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 S1344169AbjJYPoy (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Wed, 25 Oct 2023 11:44:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234823AbjJYPov (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Oct 2023 11:44:51 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2115.outbound.protection.outlook.com [40.107.215.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28C7013A for <linux-kernel@vger.kernel.org>; Wed, 25 Oct 2023 08:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E6elgvVcIb+4sdGMAy9d9mDn3LL4VDLxU5JQ9RMdvstoHXOBZmCGMLSbAzn9uQGb0MaFQ9aCnll2h1ry7umZ6Fkgy+wXJyXU2suNrdl9r3TrE86dCnqX1kGWfJC7JUjXVSqL2hDD21+l9zpSXs8X5ObcKhl1jBOjXfFa1gptNAMe3Hu9AF/B9zBPWg1xAzH4XyKgejSTzhJHGjbrNkCFz30a8l/DJouwfq6HxGpzQwuiog3RUgFyM7gskTSmD/rVEIo+5tv13G0pWjCJn/yIM+NwlbPq4P2UVOjMQ3L7lw7sVqkrP7SWopoDDnNzPwOmz9tWSsVsNqBOM+DyI99/Lg== 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=JvsArkRNo1ef55npLUNg2F+7XfUqN03zzLzjQnKI1+I=; b=aOd7TuL3YShThzXUwfTFb0Ae4wnfrJFagXmVKqL+PnPBInhuI0Q/JLoR5ajHJO5ggEaKGqercbTif0tnSkFavm5mcrx2/HWk/A/GrXNaRPoh4L0FU3rExhMbiTOvmJ+0CoG6g0WbfeSDyjGSQEI3gxcmpgx+2CMxz0ie0CovlwS1/L4hClQj4qWHcDBA2XM3VgfErWBF98e45PqZmRXvPSKpKYtTh79FunQLmvr3aGT044R8aZWXTUKM+f5vsdEdyWk+PWRn4JwvFuh9swvb9FfpGu4mRL/YvQp2XJOJsjIo8YSIOT5qDDm/w+gTh0ievwjwADbYJEz0uu+usPBKMA== 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=JvsArkRNo1ef55npLUNg2F+7XfUqN03zzLzjQnKI1+I=; b=hQ/GRUSxphDVHw52/ovSTsVVMgvj3hM+pFo85ILKFSIyJUStVenyGnL/fa3qpDCAjyvqvGiT+1rtk+la6e9DmFS1BJ98Jxgq2ysnmadkNbpoRMHI2ZukEjpHKZyhYvdnPkmZUC8KN2TcBy5NULWOAO1gegNojUO2qgcTGyyYNREDHrHwIthjEwO31fbQnXtvg6BLRRUAOGMSu5Q5Pt/YvZi2kRkDa7trigzPmS3yw6X/hPIurhksrLfB7s3PYWJDBzR1TW9GW2JQDoCwF7ymGoOT8nKv9cxkifxvlvZhRaptJmcKOQxr9YD+8ykWg0YaI1ACjcqKz/R9wcwGffNtEg== 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 SEYPR06MB6432.apcprd06.prod.outlook.com (2603:1096:101:16f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Wed, 25 Oct 2023 15:44:42 +0000 Received: from JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::ed85:405e:a2c9:1f0d]) by JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::ed85:405e:a2c9:1f0d%3]) with mapi id 15.20.6907.032; Wed, 25 Oct 2023 15:44:41 +0000 From: Zhiguo Jiang <justinjiang@vivo.com> To: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Zhiguo Jiang <justinjiang@vivo.com> Subject: [PATCH] mm:vmscan: fix return negative unneed to detect VM_EXEC Date: Wed, 25 Oct 2023 23:44:32 +0800 Message-ID: <20231025154432.314-1-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0018.apcprd01.prod.exchangelabs.com (2603:1096:4:191::7) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|SEYPR06MB6432:EE_ X-MS-Office365-Filtering-Correlation-Id: 970935b2-ff5d-4186-e023-08dbd5714db0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BUH8cDUbpXWjkKvA5YKZapmNdkkwPTFw15ItxjmQQEBLJCxiostppzad4U24i6tUqVdQZ+O3ElkhTSMxwzRjIKvo+/JvXt/gnnF3n8pnRD9PpT6MUuKvbgZWm4iN6OkM+bvZqYv4bIwrHY6DcrCb2Bul1O4yJVRDTIe5kXaC1BJqw8CYVUam4qiUCiMMZLzAscalQ9lGzKRySITnQaCdwhHRovP/6KjxF6RCb6lV/k+DDkAY0ZterNLXXLC7WJSl14jN45mB+sD0sUrRR6LnVLxk6RUCCFZu1AbiATFEztk7cWABTIb6nnGiEIsVwPA+/F2fwEBTvRBnuZEsWhLdjxGbnec9nKT1ckvTpW8UKAyehQ0jjppQUXQY1meBdAU9q87eSonsFKcLjII+efwcsQNERKIBjc3Fp4EYOLSTKST5Tadn2j+Pe+WjECrLP/UZ2g96gmOGsRqsmyabD3RNnaamUTcWMazqrSuFbHNFXjQ5ZFBVa9xs08EvQdCL3FvjDTH5apz3w5Rz+JIhvog/uuGRVWJmVwjLsRTQwEAWF3tALlE+sHyfzMyPcQ8IxjXVuYxcu0om3VCWOsgcQF0FfKdx5aBQ+DQlZgls5MB/4Djs3l4pzyPssdwM4SUczQvF 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)(39860400002)(366004)(396003)(136003)(346002)(376002)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(4744005)(86362001)(1076003)(2906002)(38100700002)(41300700001)(66476007)(316002)(66946007)(66556008)(478600001)(6506007)(6486002)(2616005)(107886003)(52116002)(6512007)(6666004)(83380400001)(4326008)(36756003)(5660300002)(8676002)(8936002)(26005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yx9BJwhYxVefEf54sVDejrgRIiE5s835WuKVCAHQt8VdYhF12VZr2PENzTU0eah+DIFwKdO9h/mXbVuamZYEIo+RgpHvG5IZzodZ/Mt2ul8mUYBlxKOzCTVyQn50BRWfNVxvtN9y+bGUPSbxAz4HV3w9tWA5H0pFGDlWHOD8YbSotg1jd7BqIOHJFMyXQ5DYQDybEhenDPT4uKRq5b6WW5NOxP2umEOX7Gc5qTwacTMHZ9fgnQlMvumTOmcYfPqU592K0NQlPGrYa0jpT+alek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WxN/kv6ZmJWUG+EUc/0lwpcAllerz0G1ttoaaFtQlFjNKmAegLQiKhnwshLXHPvS0xPz2PbZFVHVjybIXbLLp2cvLSzWUwSFc9zHlpxwOwqDhYsSut0jLvbhpvaEkgu0Dcu5W1/5e97C8sS7/hmBsgn39p7ZDYHmERv1Xm91T0H92gC86B1gzIidzkce8BgwPXVXWP3tYuVsMLUbbETEeqzNJ/wJDwl2Oge+6xFYHP83 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 970935b2-ff5d-4186-e023-08dbd5714db0 X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2023 15:44:41.6028 (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: 2LN9UhsLRk95UIVoSQWbwwY7nVF4T2geMErgG9YgeH3ykq3NCV43vh6rJk79hYorq0DPR5UAOHk5ENoFzdBLFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6432 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 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: <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 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 08:45:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780742835281775948 X-GMAIL-MSGID: 1780742835281775948 |
Series |
mm:vmscan: fix return negative unneed to detect VM_EXEC
|
|
Commit Message
Zhiguo Jiang
Oct. 25, 2023, 3:44 p.m. UTC
The reason that folio_referenced() returns negative is because
rwc.contended is 1, vm_flags is 0 at this time and so there is
no need to detect VM_EXEC. And only when referenced > 0, pra->vm_flags
will be filled with vma->vm_flags in folio_referenced_one().
Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.39.0
Comments
On Wed, 25 Oct 2023 23:44:32 +0800 Zhiguo Jiang <justinjiang@vivo.com> wrote: > The reason that folio_referenced() returns negative is because > rwc.contended is 1, vm_flags is 0 at this time and so there is > no need to detect VM_EXEC. And only when referenced > 0, pra->vm_flags > will be filled with vma->vm_flags in folio_referenced_one(). > > ... > > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -2095,7 +2095,7 @@ static void shrink_active_list(unsigned long nr_to_scan, > > /* Referenced or rmap lock contention: rotate */ > if (folio_referenced(folio, 0, sc->target_mem_cgroup, > - &vm_flags) != 0) { > + &vm_flags) > 0) { > /* > * Identify referenced, file-backed active folios and > * give them one more trip around the active list. So I suspect this email did not make it through the linux-mm server. I can't find it in my archive or at https://lore.kernel.org/linux-mm/. So please resend? Prior to doing so, please update the changelog to describe the before- and after- userspace visible effects of the change. Thanks.
diff --git a/mm/vmscan.c b/mm/vmscan.c index e587dafeef94..f0b4325cccd4 100755 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2095,7 +2095,7 @@ static void shrink_active_list(unsigned long nr_to_scan, /* Referenced or rmap lock contention: rotate */ if (folio_referenced(folio, 0, sc->target_mem_cgroup, - &vm_flags) != 0) { + &vm_flags) > 0) { /* * Identify referenced, file-backed active folios and * give them one more trip around the active list. So