Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3583288rdb; Wed, 27 Dec 2023 12:07:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+OQVzG49znOaqntZ79+8M1fNG6ISwEFYyK79GFG4IyH/MPKxI7IQ3wgF+3VugW2BNNfJv X-Received: by 2002:a05:620a:414b:b0:781:13cf:bdf7 with SMTP id k11-20020a05620a414b00b0078113cfbdf7mr12698417qko.105.1703707621638; Wed, 27 Dec 2023 12:07:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703707621; cv=pass; d=google.com; s=arc-20160816; b=lknOpikWAAGpxDfyGVM7sy+T1FPPp8B9JAiiqIdN7mTK+kEyqdh+/SvlHomfqtya3A uo65VE2GFrjH4sqxZs/6G1JG+uV8ycn3QmRk8FiREyUnHPVGQx0VHl8F9z6cuoAHW5GS uWHX6VgxraZYJc66/aKhoGqDyXs4UpEkpUpTcGoALnKeGnPvMuZTaQbIpFhVh28d33pl PAH7b2H+MIBfIY+eFwry4ImoQOGHblcn0c3Cu/3b8R3PgqN6o9vm75F7HN4pphF9fwLt w4cKZiJuag0FwCgqaGBpgSSs/TwhjQMHjgZEZ1/s2I4zbUQuuZu8VvGQrOV/JmzP/ppU fgIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:content-disposition:references:message-id:subject:cc:to :from:date:dkim-signature; bh=4mqZ9GUrVivXwKJL1Ar1SgstFRRf9UsTvA7mW+n08PQ=; fh=krMUuVBSnc+bMgzKcPdnQf/ITHAV0cxjzn6h/7t5tdA=; b=wBuWczVSrCNSdG+A+bezPa3ZvqoGypKrTFmBYJvVcgJrw4+A/mmULGd7IWraejEw5H 9lN1qY/QmaXHnlas/jTqoi6xrK33TWDWOpQkGRSb/GXvNVZ2LjvHNFWvoAwPshVcfNMy hg8vTfUiu/jD/51kEPlSyLGaxv4XIVVP2pIBs/RFUVE68ac3MjziK9MUQ5XH4zGERv3P KmxaoL1BgNLSADAUUacy7AsWInHh3uwy/TVvVxSPEhKQnES6QA5WqGI3ujmKfFV5ADWi 0IpekuGKFtm9AcMITGpjvEvMQXtMgrw7MWzGnJll7nnE5BbEcy2D1vBbmiCzzkY/8NlT FKyQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b="eLM/2AZB"; arc=pass (i=1 spf=pass spfdomain=memverge.com dkim=pass dkdomain=memverge.com dmarc=pass fromdomain=memverge.com); spf=pass (google.com: domain of linux-kernel+bounces-12236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12236-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s18-20020a05620a255200b007817232fbf1si146777qko.161.2023.12.27.12.07.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 12:07:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b="eLM/2AZB"; arc=pass (i=1 spf=pass spfdomain=memverge.com dkim=pass dkdomain=memverge.com dmarc=pass fromdomain=memverge.com); spf=pass (google.com: domain of linux-kernel+bounces-12236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12236-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 508431C21A1A for ; Wed, 27 Dec 2023 20:07:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 038E347F5D; Wed, 27 Dec 2023 20:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=memverge.com header.i=@memverge.com header.b="eLM/2AZB" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2073.outbound.protection.outlook.com [40.107.94.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2F0447A4E; Wed, 27 Dec 2023 20:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=memverge.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=memverge.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aZ0LdbOhknycNV2Kn4h9fcK6KLkNqT0G+WnTkMM/9F+bgGP4f9/CYPQ2/UZSdqqiEpmn3YYzB44n/1t3rJZQFQI4asu8h+HAeXc9WqoFtt9b+pZ8YA0UGPphep+Ko3OeGm27PpMAHnYGmo1jrjzfsuWqeV/B19rrhoooloRco3vhRR0cmqqQuvl5b5WTA0LuoikHp54Y5FI2osim2gwCTD4Vts6YoY8m46YkjeJy7/QmLPZuauMXBbF7U/0zAKpObEIWjA89jFY3q0r246t7VrUqzOgNKyoRoAM0N4rf8+JXnjvBLIIBYWhGYKMok3hpJqxOnG8b/Q4nBxHWzILiKw== 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=4mqZ9GUrVivXwKJL1Ar1SgstFRRf9UsTvA7mW+n08PQ=; b=YEF6YChxcyyhsVIBN5QCzziywM/zq2vv3E895D637KO8+/AiJdyfqFZvxSTxzMEv2Bd0jdr+8SIt3gELRVIP2k7ZwaK6zEaptnII7hIHasXSEdKCnOmQwHAIjF51+OmsrH9s2w9+lsad4pTmLSxPZYiZWNxbNFA4MYljMh1RhxBT+xG2e6BGsQBFZvEIaWcIwUkT1IRBBlHLh67T3bQDLaXhENd2ZcRBBsLRPHAWa6ZgBTuOCF9hlKKPrEK24e8oWCtqoEutbJPMrmeDzx5DPd/rS1o4USFvtDU2kjzVoDjfr0R0bor+DxKTKwH7qs5gHpfB8s3otVFyzmboiGs4NA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=memverge.com; dmarc=pass action=none header.from=memverge.com; dkim=pass header.d=memverge.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=memverge.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4mqZ9GUrVivXwKJL1Ar1SgstFRRf9UsTvA7mW+n08PQ=; b=eLM/2AZBmDuhcGUW3aSRRZwI62YWWjm5Kl5UK5tyok53uepq3/fOWy0p0TUlNRkLN1zRB0gH1tY6z3hNT6KCsl8oWeyTKxIpehCG8v+ebnWHgqZDejGdD5Skz3GdR4GEi8UYnXrbgXCXpLe8mab5m7DaPJJG57mwSYmXpdnXNDo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=memverge.com; Received: from SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) by SJ0PR17MB5557.namprd17.prod.outlook.com (2603:10b6:a03:393::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Wed, 27 Dec 2023 20:06:44 +0000 Received: from SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::381c:7f11:1028:15f4]) by SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::381c:7f11:1028:15f4%5]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 20:06:44 +0000 Date: Tue, 26 Dec 2023 06:48:34 -0500 From: Gregory Price To: "Huang, Ying" Cc: Gregory Price , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, akpm@linux-foundation.org, arnd@arndb.de, tglx@linutronix.de, luto@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mhocko@kernel.org, tj@kernel.org, corbet@lwn.net, rakie.kim@sk.com, hyeongtak.ji@sk.com, honggyu.kim@sk.com, vtavarespetr@micron.com, peterz@infradead.org, jgroves@micron.com, ravis.opensrc@micron.com, sthanneeru@micron.com, emirakhur@micron.com, Hasan.Maruf@amd.com, seungjun.ha@samsung.com Subject: Re: [PATCH v5 03/11] mm/mempolicy: refactor sanitize_mpol_flags for reuse Message-ID: References: <20231223181101.1954-1-gregory.price@memverge.com> <20231223181101.1954-4-gregory.price@memverge.com> <87y1dgdoou.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SJ0PR03CA0271.namprd03.prod.outlook.com (2603:10b6:a03:39e::6) To SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR17MB5512:EE_|SJ0PR17MB5557:EE_ X-MS-Office365-Filtering-Correlation-Id: 9240133c-ad2a-48b1-0e87-08dc07175907 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nOwoOGkQ9rpy9Hbz3FQj9I9gcl9+/ENmPvacqq/Hpl5nbeAX2mMbwKXGhAazU/t/OdkqEcHr/eBhmXtR3p2pettmm9sQ/rbUXi8WEtkQjF3zywD2sFhgf2sO6r41FsR3oLEuv2FBXumlMIwvSBRb0hh5ZS/jXls4BI0nZDYMB6F9LWw9WNey6vTH2j/hvgl9pxZQEgGmXljBjmkHSQQWVeSgpKtdrTbcesSiDcwTVZcKgu/al0Gsc9t3bvrU2ldS7IBF8I/5Gp9MgOZDBcCNbH/3h3w79ZWokkFpvrYa1TgkMOSrMNLJt6cM6CaPAT1zGkKOExSz5WjGKUK1diyRgNlE0Zt2VMtF6R/9T4JFJXf682/RRfFnW57uJbLaUYOyW23JxhezNBaYKHPU3YsdzUfrPaDYaq6yPZwLaW8iQQKh8HCCNpDUbMiYbpB8cDtXzpSYRKEStAJnB8UmLcM50p9WpccJfxKpgxZoEZqxnODC9hH2tX+srz5Q0gHaOOBsdF7vtHQteOdNX2k9hrOXKA/iIsvPzKOdrJ65/FXLEGlB7HeJKDfeOuwjmo3DgOV6bSFm+DIKVdNsag78n1WO2rSG6nw7Lv08PZJJLAYvZ+FNjfUpEVbQQlEGyO8NvVTX X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR17MB5512.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(396003)(366004)(346002)(39850400004)(376002)(230922051799003)(230173577357003)(230273577357003)(1800799012)(186009)(451199024)(64100799003)(6486002)(8936002)(4326008)(478600001)(6666004)(38100700002)(44832011)(26005)(2616005)(6916009)(66946007)(86362001)(8676002)(316002)(83380400001)(66476007)(6512007)(6506007)(66556008)(7406005)(2906002)(7416002)(5660300002)(4744005)(36756003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?K/3AInaXmXZ7xvZbMWxN7K6GudR3mdt56bOrVs0xJTPL2CWgVGjCrZHeVQpV?= =?us-ascii?Q?7+PEhMoCtNkv3Wnes5AWH92Cm8Ae64Obk2t4UAQbvCnzPbyLxaQKYmDE2xsG?= =?us-ascii?Q?I2eWf+tsLbt8xNswnz+TKYgz9U16Ke49inAWHGs6kwmXIL6TjpTAXfQW8jCX?= =?us-ascii?Q?vSXLPbuHNgU4Eho1JN6PkptCvgz0c+5oYnfCotxfJd0LDraxzNFkthWQbS1G?= =?us-ascii?Q?Fb8LFfN15h/Shgmvuc9bX7P6Kw9u0q8jIAtL/qYyEO+X6v+Qond9Hnjzqoih?= =?us-ascii?Q?tPqhH9A1mFOV8009ijHDktMHFBD+Kurhxdn6q2ENuWIkCnf9qompro7FXWqz?= =?us-ascii?Q?g7r+IXuU3N38/VIH2MvZwDXP4ZIWu94TxkUut4unLqEIHQmTBjxXBZbb93OH?= =?us-ascii?Q?JMNHobEquVX9c1LAT05qs9OvjWBOnBVmvavUZRvMOnGwZWWoKp2/tG7ikPhC?= =?us-ascii?Q?V/V9UoZx24bP5dpUHdpp6OpVG8bcrhu3fPSnaOmwz52bRzAs9eA/WDldVs/R?= =?us-ascii?Q?IntcvJ9awkH0iUSwucO9qULgLzHo+p4zOrP/5tGwzSPSmBXzJCu1wgcce2ze?= =?us-ascii?Q?cLlG+58buNmm+bhStgaqOOcnmQit7vHJMgRFp+CVER9bGaEW9Cv1FWLUdAHd?= =?us-ascii?Q?wTZi6qSGYuMy+FZ5vCKVv7pBznLZcxiUCTMZB4Y/m1I7/5qgE8kazCTJLpmR?= =?us-ascii?Q?upzYGSKHrq4+tSOqncRfVoge6ati3K56p/T6jBKfVcp8qhD4Ya/u/avErlrD?= =?us-ascii?Q?PB2u9C2dR8WRs9vQOnY2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message-Id: 9240133c-ad2a-48b1-0e87-08dc07175907 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR17MB5512.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 20:06:44.0624 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5c90cb59-37e7-4c81-9c07-00473d5fb682 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: beeW25LLMbz3SOuU5qIB4ohX36Mxlu29wurzwW6THd4AmAsZ90awEMAXW74BK3DoIPHWEd7kDQYRse++sXnRS9rFqz1WrHHnwItjw6Akmqk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR17MB5557 On Tue, Dec 26, 2023 at 02:05:35AM -0500, Gregory Price wrote: > On Wed, Dec 27, 2023 at 04:39:29PM +0800, Huang, Ying wrote: > > Gregory Price writes: > > > > > + unsigned short mode = (*mode_arg & ~MPOL_MODE_FLAGS); > > > + > > > + *flags = *mode_arg & MPOL_MODE_FLAGS; > > > + *mode_arg = mode; > > > > It appears that it's unnecessary to introduce a local variable to split > > mode/flags. Just reuse the original code? > > Revisiting during fixes: Note the change from int to short. I chose to make this explicit because validate_mpol_flags takes a short. I'm fairly sure changing it back throws a truncation warning. ~Gregroy