Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp820292rdb; Sun, 18 Feb 2024 13:38:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU4l6koSK89v3Rja8wS9H9/VJnIK+0rQugSbKq6XxPrgSSYzgz+AhmM88Xa06EkdkFFPigWIuDr1Z0HKUwGNxvUUb1ToDbyIart12QrFQ== X-Google-Smtp-Source: AGHT+IHY797kN229aaGWAJvGAr+ro+Bfz2HDFKeUk+JPnOfrsKDIkr+iL4v3hN826AKKN/u3ecsD X-Received: by 2002:a05:6a21:3115:b0:19e:bab7:6185 with SMTP id yz21-20020a056a21311500b0019ebab76185mr11037006pzb.31.1708292339560; Sun, 18 Feb 2024 13:38:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708292339; cv=pass; d=google.com; s=arc-20160816; b=XHxZIoVJ5MtmPpi0B4QSYSbO998J3diwSJYusg871Ldx78up8FRhhb3PSFEjJHFEbJ Ry6MmNj6MekCZ2cj9sABYUNZtrD6ueXjaDALLNR3OlnB94XHJdT7XnIe2sl3Nj7aLJp3 pZwDFySRQuwxw9KmxZ26neZ+/yi0Clik4NfFHS0COID1TznIeQbZMTwfnhUwPxYHskzE N4bxrEzn1sY+Vwj/54jthCZTgNgVWwZq5iAFbGBH+pJbXwCiet59zEHAyjMZ+thC2wbZ 1F8cDew1BWNsbxuaasYCYs325J+J/n0ne9eoMHjqURa4zqDwY5h9NM6RR1+5SiS/XkDc SMaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=xiVXO4rHRWfGZ5oxQolWqb94buuIBeR5xbwyH8qjg5Q=; fh=oaJILGMyl8AgouPFjkU6vrw2ixmffovi74Fp5oMqWcA=; b=hWoiJzsYobQGB4vEEcVEj0+YeXcCyM9iFyWHYeNNQ2kO7FbgwotdW8bVCPZh/nfO6v ib5RGU78Xsi8mQw1qkKtGJ7qWQznMordS1w7VmxTrzDBp1FtWSPThWLgxcHxn8CwhfKY dNkaA2EirQnvfNUcmJCEbo+v99H+iJVL0BmTRY/BHGS3fLDgdWZADUlp4HlkpDfYWz8e h9ezhTDvMwFnc0nsLqPIVH1/s2B9weGY95obiwuO3O7xvjDRtY/9Kj6yYPVWWPQjAg3f eaEHjPpyFSraRJL4EPHxzQS2RjEq61Mx2IRQ36vVgmjDX4G1m5mfWYkcb+mDEyiwxL3H Xxmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="Nbp/Ink4"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-70592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70592-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fn16-20020a056a002fd000b006e3d627f231si1948294pfb.305.2024.02.18.13.38.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 13:38:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="Nbp/Ink4"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-70592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70592-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 33E7E281624 for ; Sun, 18 Feb 2024 21:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C59B74281; Sun, 18 Feb 2024 21:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Nbp/Ink4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9C68573175 for ; Sun, 18 Feb 2024 21:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708292333; cv=none; b=PlZM/UngM4tuZArtdusBWM9el5tvzk55Mad+YPKt2RHMwfBA1lgd1W2pGhIJt0a1L9ye3+Ra/ZM2PTTMqjx8QehyxjzwAbyIsivr2qhJkYbFdPCWuCT9zCDE51tliiOtJOpKSonwotsulK1qqQo4l2+WT8LMkQpaBE8isJgiWyk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708292333; c=relaxed/simple; bh=KKc8FE2bdtNuk4G8An0mXCAzt6JMeCEm+SY5mrD71fU=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=s9r+FUc8WaMuboNIxip2tUB2u2UYFMW3P0vbrC553DwQi1+1ds5tGfkmBiJdPqxFTBdAErsM83/4bOF394O1XGkUGR0M/Btd/o2RwUiDB6OVHzAquhXeIO2zTYT5WtvLExgAoxQeEFQQIQZ9FquKM5YhWZwpeOK/gXAVQH0rjbk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=Nbp/Ink4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 695DAC433C7; Sun, 18 Feb 2024 21:38:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1708292333; bh=KKc8FE2bdtNuk4G8An0mXCAzt6JMeCEm+SY5mrD71fU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Nbp/Ink4ziA5vhwf0sUWh7CGnF72TQNaoyWHagIaLFeTUecm9hccCnqqciGQhjWKO di5+uSUjSAvJEgiscCFr9wkhUdICeUCPnH0cecv0Xc1vrompSDxzq+IV/O95Vb0SGi F3AkUjQkxE8izaOhvNFZiBan40lDCpm4Nnog/IGI= Date: Sun, 18 Feb 2024 13:38:51 -0800 From: Andrew Morton To: Donet Tom Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Aneesh Kumar , Huang Ying , Dave Hansen , Mel Gorman , Ben Widawsky , Feng Tang , Michal Hocko , Andrea Arcangeli , Peter Zijlstra , Ingo Molnar , Rik van Riel , Johannes Weiner , Matthew Wilcox , Mike Kravetz , Vlastimil Babka , Dan Williams , Hugh Dickins , Kefeng Wang , Suren Baghdasaryan Subject: Re: [PATCH 1/3] mm/mempolicy: Use the already fetched local variable Message-Id: <20240218133851.22c22b55460e866a099be5ce@linux-foundation.org> In-Reply-To: <9c3f7b743477560d1c5b12b8c111a584a2cc92ee.1708097962.git.donettom@linux.ibm.com> References: <9c3f7b743477560d1c5b12b8c111a584a2cc92ee.1708097962.git.donettom@linux.ibm.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 17 Feb 2024 01:31:33 -0600 Donet Tom wrote: > Avoid doing a per cpu read and use the local variable thisnid. IMHO > this also makes the code more readable. > > ... > > --- a/mm/mempolicy.c > +++ b/mm/mempolicy.c > @@ -2526,7 +2526,7 @@ int mpol_misplaced(struct folio *folio, struct vm_area_struct *vma, > if (node_isset(curnid, pol->nodes)) > goto out; > z = first_zones_zonelist( > - node_zonelist(numa_node_id(), GFP_HIGHUSER), > + node_zonelist(thisnid, GFP_HIGHUSER), > gfp_zone(GFP_HIGHUSER), > &pol->nodes); > polnid = zone_to_nid(z->zone); int thisnid = cpu_to_node(thiscpu); Is there any dofference between numa_node_id() and cpu_to_node(raw_smp_processor_id())? And it it explicable that we're using one here and not the other?