Message ID | 20230907044045.709-1-justinjiang@vivo.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 266E9EE14D4 for <linux-mm@archiver.kernel.org>; Thu, 7 Sep 2023 04:41:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2BBC4440170; Thu, 7 Sep 2023 00:41:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 26C3A44014A; Thu, 7 Sep 2023 00:41:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10E17440170; Thu, 7 Sep 2023 00:41:08 -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 F27D744014A for <linux-mm@kvack.org>; Thu, 7 Sep 2023 00:41:07 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C5779141037 for <linux-mm@kvack.org>; Thu, 7 Sep 2023 04:41:07 +0000 (UTC) X-FDA: 81208551774.16.771FFC2 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by imf23.hostedemail.com (Postfix) with ESMTP id EDDC3140008 for <linux-mm@kvack.org>; Thu, 7 Sep 2023 04:41:04 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=aMnq2Pab; dmarc=pass (policy=quarantine) header.from=vivo.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf23.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.117.94 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=1694061665; 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=9npfzMziSq3Jb5vgkWFkpsXZGOuaf6whDU9jNC1M8PU=; b=kL9XtUVPys80pSYlLiOsjjnbZouuHMmbrvraeYVMmQNwU3nutEeBVRx88kT2AFp+5fZtTA okkFypLIERP+2TklruDV/NH8mYE1Vg2Z+7LupGWwVKxsHtpTbXDj4qoSrSNaQ0AuSA7vDs JCrVbXY/5wKljqjzCsLIjT0eAKfyjVE= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=aMnq2Pab; dmarc=pass (policy=quarantine) header.from=vivo.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf23.hostedemail.com: domain of justinjiang@vivo.com designates 40.107.117.94 as permitted sender) smtp.mailfrom=justinjiang@vivo.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1694061665; a=rsa-sha256; cv=pass; b=yZPokA5o8bzSKxox4uOtzQTBAI1ltMse1wDdsw+TO0+3ZeYaM/GoSbMgYYuFh07u5a3MrI qap94eS7Y3oFO7yM151gwgEpcI4qc9otxmVlKeVG1D2SrImtUEqs3rjxVbodVRAwwO0ZTp dIDwAwiNsjU2fZASGPYxCzee+jetAPI= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dALJPD7bLS9S3vz0HEbyxxowuXzoCU+d3zwuUrqytqKYcYX06duaTT0nYakH8ibT9O67kOdwpo0gsyVl/YnkTcGfNmLg0y/tXm95j0GiNXP642vw6TctizqrjGMYq6WA0qoN9SxzJTOfnPSjIf37utTPlQXwHpNpWgFu+wbGImzFG2ZeVGbCZuDx2C0JQhWLmDLPVsKFqNFDMvnqZqs3EAiS/Jze3DcXzEPlp6/LxDYYfG0h6xnOkfcC5rE9G2hn2etJcgWzI0Hm34Fl3G3pKUu0ewqH1kLFylQJU3LHt1ahUG+cZu0HXCbtDVVZSjY5vV0M1UYS1h1hAxgw7rneHw== 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=9npfzMziSq3Jb5vgkWFkpsXZGOuaf6whDU9jNC1M8PU=; b=e4laFTzuc4llYSlkhVlGTp9PX046LhX7BcnOGjo/oaMIvTr/jIqBRICY2Lai8Z5o/4dQwNzmgWJeG4FXreVieIfz4vxwUIGzy6eFArHWT02KvxtSJGOvhZlm3IHPyV8XfK3Qhn9zNkw+D/ExpedWr1xmdEorOG8ofnvYZrhMjhvdlRvu0gUtcFwhoBue35+0Xd6xaz/ZTMz61VT7M0Cx5JyJm9P74wfGDoVy0HYMJrnw+5xB6tBTdmOJ6rS64k34HsmAvvG4gD+LAWALiymwMzdO76V5f8ejTyjI9oq2TV/T8UPyvR5zD+tmVVVXBsXiARoUYb/NBcDw20Eo3BbpCw== 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=9npfzMziSq3Jb5vgkWFkpsXZGOuaf6whDU9jNC1M8PU=; b=aMnq2PabjjkMY4IWCNWFfLJAB9PB3EOxaiHF2OZHQMfbUN8jlFUCccFZQFinnyl1H874pboHD9CDwMX1ZKL3N9H6naduQLBOwkihySdnlL7dpa38J6eZ9h01waVx82iw6tqwhUmLpEPGMf2AemCYrgLJN2K+eKGRPNceDfxF1cgX9FnI3zzEC0EmNRpqK73E9y4BQRof5Md8GUl9iRNygjXvt8qMt5ilmXPuZLz13fw2MBuJ2PMTDvjF383Oxc1DkxOWqYO4N5nEInlmjiSEKnERNJZrVN2cyLTA8sU4aFOyWb738LjeA9x5wePW0heJuZZbRSaSjyNLF4EE/fTPiQ== Received: from JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) by PUZPR06MB6172.apcprd06.prod.outlook.com (2603:1096:301:107::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Thu, 7 Sep 2023 04:40:58 +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.6745.034; Thu, 7 Sep 2023 04:40:58 +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 get_swappiness() return value type Date: Thu, 7 Sep 2023 12:40:45 +0800 Message-ID: <20230907044045.709-1-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0003.apcprd01.prod.exchangelabs.com (2603:1096:4:191::16) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|PUZPR06MB6172:EE_ X-MS-Office365-Filtering-Correlation-Id: eb9babc1-cbd6-4193-3020-08dbaf5ca120 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HThej+b4HpCICkLV9dguUES5OQ8Njt7W0P3dpxqBeITpKfxrLa0yblpIC3j2WpK+TaV+iZIqOjoNCf8Q58YsdQs/UsQkQDBaWZu4oLR4HAQTbQQmIIm9h4sU0JVPeLKI464F8WpOAafW0ODNYhAaEX9jLuwwc9uz20eWZMejeEGDpqh0++fm0q19npU/OrCWsNDnpPHpwGA8UO8ceUFNxnul6zs4MK4ruJ8rISEvnwQlSlm8PlZrOlAThb7bJsOgu9mnhwSnGg5iKMPJZfVHCAQKXJlmGPpLQgRM8W2YaXFhVE6Pq24A59qi3Pmc2qkMSEVr4Q4oIQaKjrqVQhWh9Y3RiPaAeGLYH5WggCToJiOHCT8n6iIFERuYX7e0h1YgW44e99bs7uucB+5UHh0OX3fWLOP1VDFz1x6YkEwH/5dLtupL/QK2WvR2XBSt7EGHe8s6N/NA6ld3uwI1ekln4lS7q+fmHkPhQvoE2SA+hDef2Xa6JYvucpAez6dCK4OGnP3/dPGwl/6jhu+HRcujbcZgE9se+06O/QQff7lArtj/3O4V/5ybMkNPVsj8tLzdYGqKloe6MbWZ0nPH3kqyI5LryLtWKYw9HIPNCEngDyIT/w1ThhHHSxD1zo55ASRA 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)(366004)(376002)(39860400002)(346002)(451199024)(186009)(1800799009)(38100700002)(41300700001)(8676002)(8936002)(2906002)(4326008)(66476007)(4744005)(5660300002)(316002)(6486002)(86362001)(66556008)(66946007)(6666004)(478600001)(6506007)(36756003)(52116002)(6512007)(38350700002)(26005)(1076003)(2616005)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-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jeZW1z+OFmTgEgvlQqa6I0e9n9cCcqQwe1HyH6gT0wvzT56ER+gan3G1Fz0iCf5mPpsiNXiD15uMrymsnLt48dWWqH4mTkg5HDkf8jw3UQmlOAoHGt91xQPJVNquNr+cFTGAMrgqcRWRp2fIwLAbaYA2Rj3mNVTee8iWFI75qzlqOp35rfeIJAwyy13J9XVuVe+rA81MlL7Pdile2qBO8m0Exm07p+vV+YAMuPgTpSUO66ZyjuFW66786GC5TpwsmVNa9+O/rLnBSE3OcyvrA3F+hGV9m3hcNv0+bzfhQB3EeF+bVx2vyVIVSlIWfVjAIYW4w5NbEyBej0jeUy6nUpKsMPMC36F/7KaMsvQxUXj2MJNCChBcELLRWg3Xswp29bvuq7/A6EoYUCVw5S9D8rW8/iH/vRMgXwHwibnQAu3w8cK8v/QC/klnqvWccQn+16tj7vHASiyjFNuQrabY2X8adc/QB+AhrUw9ahDQY//t4eK2S2GxuXBcMsf9533osJn4Ta/9EaB5FAcjxq X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb9babc1-cbd6-4193-3020-08dbaf5ca120 X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2023 04:40:58.2540 (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: j+AeSFp56bAK0Mu+Eac3+9iEb9GruDi314Zvp4h/gQ5PrYfIfN7kO+DP5gMXpNc9CWGspfjXPX0arQu/fVzLGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6172 X-Rspamd-Queue-Id: EDDC3140008 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: hrtxbxnqqnayzipck88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uijrHPpJDSRUxu6caPRXlSopiURae5jdlfB+wAfxC6YhB3rnV6tdXyoiME2OspbOD4dedi42fJArhCNkvvp5+zqG3dVRGCDGnV/IeEhkTuMc6uqrwZXvcALCkPxi8MB/LoPl0zIbq6hQL3J844usOk/rn6uedvecRmuMsMCTJOAjAg0z1VUySbh4G/SPvXO9/Ob8oTEtOC2CekjWbVMyoWErJ8vDvSBHLJbjx7Wpo/69XYfHNpoD2Bhes= X-Bogosity: Ham, tests=bogofilter, spamicity=0.004043, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
mm: vmscan: fix get_swappiness() return value type
|
expand
|
On Thu, Sep 07, 2023 at 12:40:45PM +0800, Zhiguo Jiang wrote: > Fix bool to int of the get_swappiness() return value type in > lruvec_is_sizable(). > > The get_swappiness() return value type is int, but the > get_swappiness() return value type is bool in lruvec_is_sizable(). > So there is a possibility of value overflow. Have you looked at how the C spec defines int->bool conversion?
diff --git a/mm/vmscan.c b/mm/vmscan.c index ea57a43ebd6b..f383e5b14598 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4575,7 +4575,7 @@ static bool lruvec_is_sizable(struct lruvec *lruvec, struct scan_control *sc) { int gen, type, zone; unsigned long total = 0; - bool can_swap = get_swappiness(lruvec, sc); + int can_swap = get_swappiness(lruvec, sc); struct lru_gen_folio *lrugen = &lruvec->lrugen; struct mem_cgroup *memcg = lruvec_memcg(lruvec); DEFINE_MAX_SEQ(lruvec);
Fix bool to int of the get_swappiness() return value type in lruvec_is_sizable(). The get_swappiness() return value type is int, but the get_swappiness() return value type is bool in lruvec_is_sizable(). So there is a possibility of value overflow. Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com> --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 mm/vmscan.c