From mboxrd@z Thu Jan 1 00:00:00 1970 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 1A5AAC369CF for ; Sat, 19 Apr 2025 05:38:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5612B6B0007; Sat, 19 Apr 2025 01:38:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E8316B0008; Sat, 19 Apr 2025 01:38:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C7476B000A; Sat, 19 Apr 2025 01:38:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0F3136B0007 for ; Sat, 19 Apr 2025 01:38:32 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E6B991619C4 for ; Sat, 19 Apr 2025 05:38:32 +0000 (UTC) X-FDA: 83349688464.10.961244C Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by imf26.hostedemail.com (Postfix) with ESMTP id 20BF4140008 for ; Sat, 19 Apr 2025 05:38:30 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=tRkhwy+6; dmarc=none; spf=pass (imf26.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.47 as permitted sender) smtp.mailfrom=gourry@gourry.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1745041111; a=rsa-sha256; cv=none; b=KNQfDx6RkcIcgThcmvxS7W2Qk/V4erNmukk9t4P6gCw39mw4o06/t3Zv5oZzN9BP4G+SC2 tO3fAlge/lUV0Fv8/7987ZNjSiNKe4rBeUVxszLxH2WQgo7p+OikbXuqDVwDc+2WAu7a7g k3Zbqhpke2zsm8l38vByMGJG6pj+R7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1745041111; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=w1bTt6yFTuQ7vQdV7xpRPwjzlibRkEqLBXyWJok/2X4=; b=qAsMw2Vj5EmtvvOYKvO0waum3S9NqTU3iCiBqFKLeBiqDzgvwNaibXhIOgF9B93UHlDIkR b9eZd12pYKxcQ1MZCPjhsbqk59CMFRdB8eBmCH5xSglr5S3DWSxp9C7gU+f6jRdBfCBVdH 0SY9+ydtETuDczI96sUQO8nnVXjfQ2I= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=tRkhwy+6; dmarc=none; spf=pass (imf26.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.47 as permitted sender) smtp.mailfrom=gourry@gourry.net Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6e8f254b875so24056136d6.1 for ; Fri, 18 Apr 2025 22:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1745041110; x=1745645910; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w1bTt6yFTuQ7vQdV7xpRPwjzlibRkEqLBXyWJok/2X4=; b=tRkhwy+6UI/7iX6NqxwpAwsf2DLeHNp+6yOlNZGQzBccaATBmamXpLx9tqZxheGxYP FbxOnGt4t9WWAZtLag9z8/GBHWV2QO+3pBxSxusiPsMyQSGt3Fw6SfXXUaDjSCGc61Yz ZZS3WjwjgNFlzn9zBXhZpJvZEc+zDSVA665IlIlJlc4QW0rRhkiAOyHNPuUT78i+7GG4 HKxnJWXZTfD7O5ePqPfgd+SfzrfIM8xztSEJY3pKKqLQ7cNxmAj1QpPYXBOK3m2M3ak/ BXZ9F5Ql3t4gF/xseahyrpXvwebrOYlsOUIelFsVaeeIwhfkbfFWNOUyT45MwC9LqkDK GEuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745041110; x=1745645910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w1bTt6yFTuQ7vQdV7xpRPwjzlibRkEqLBXyWJok/2X4=; b=BFMtuiSW6V8Nr4UyDFCP/oqP/fgwdJflfgNRYSwdjqnOQzh15IPFps+N57oFRWUaCw SOkKNmDy2hpHDesJo7dj07ZQdmWiTInXDFvysurBBBjjposEOJYeZeNOuA7KARyQ9PqP quSzrV3OBUgOemcmg1iEMq8yl4FnZ1IHk8QNPvT2ZHY0p5NWYnrEW6fKAwuoKPolNNuf nKfL5DldtLcOhwMNdO7uvtExPy/dDUrX07CL6ZKqtgZfAORvUaOa+aN2eDZZOIrAAAU1 if0K5lPlrLBYzl2RB6ghqvXS8stZldTDyEP6pwCwO6UVbr9WJS/NPRQA5fYCkp6dbwb6 cugA== X-Gm-Message-State: AOJu0YyiL3aZmsWYvfIZo66xzWv1yYo7AQbQo/hn4D/Z2xzmB0kh7MqW 0D4h5D47NMCHhf2W/XiJZBcsPhp/YhkFDxcrIsDj93TJQuJrzdOKmn6gpklqkH9mJOzWYQem09O i X-Gm-Gg: ASbGncvIqb1M119ZeCCoogGK1qMIO/xuQjcc9K2WMGnhIBTX86fZ+niDdsVnSOEcKbb SIS+EO+flCyIrUXk+pGpCuoDIvIBA+xuHpd59lxWtz0KE3jnXQz8mrZsgCSDP5W0PlG0Xe3EaAQ IFo9Fnyt36YtHNXiLXNgQJJCK49P2DmTWo5tEj2xtRqGWlUsQQxaTsAnz4LnUl3oA6HLvSws/Xz ZpucJSEIGc6EB3soN8/EfS39jwEW9caZUOyVtcpaQJpYBOH+54dQOVR42pczNjgWWeE6OSB1zOu Pd0EVwFPNvnCEWaURztYvMa63+iMwDkzkUYsFXKA0r5A1EEu/yM5G5ve8Mv6Rpw4H8OChHYW1Po 1nhbXN55YzVxH+ZlYy9gtjCUO6wE3 X-Google-Smtp-Source: AGHT+IGCrA8A+FHDapqOFzvLIREWI4Jo2OiyP1UKGY1JE22mQ0QmetHADCci956kIivIzU/KXqVUhw== X-Received: by 2002:a05:6214:240e:b0:6d8:9ead:c665 with SMTP id 6a1803df08f44-6f2c45a35dfmr93433756d6.27.1745041110016; Fri, 18 Apr 2025 22:38:30 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F.lan (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f2c2b30c65sm18341956d6.51.2025.04.18.22.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Apr 2025 22:38:29 -0700 (PDT) From: Gregory Price To: linux-mm@kvack.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, longman@redhat.com, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, tj@kernel.org, mkoutny@suse.com, akpm@linux-foundation.org Subject: [PATCH v3 1/2] cpuset: rename cpuset_node_allowed to cpuset_current_node_allowed Date: Sat, 19 Apr 2025 01:38:23 -0400 Message-ID: <20250419053824.1601470-2-gourry@gourry.net> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250419053824.1601470-1-gourry@gourry.net> References: <20250419053824.1601470-1-gourry@gourry.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 20BF4140008 X-Stat-Signature: r9k3hbo87h5ruqag9ydrayyskg3krmh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KhdB/LJF+X17cLLceD7jdTGqa/upKgQ867oi/TFkdt/jw5f0Oo91+v2fw9c7kydOShInIcw0YPA4Hj28VXnWNTc/PnxQGluSy4ukoaQKjznxwFzdu3FdHc+PDKyIM+zaNPtObuZsou+9SpDxjGgFeKWyPB9V6O2yCoYvtJKTmuJBS/Pkm0bfdpPzpMfCb+NCXuOwowew1AhM1rhANwmQbeByoqsFo1QZmoVOBEDLjpnkEJbNO21jW1Ys4Q0Ldr1AOXgYhe/+VRhYE9Yoo+lR3ghQhdwgwT91KtwjrZEm4E2BAePhAOhh+8WXRyOKpJ3ZLrwtZ9u2OSA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Rename cpuset_node_allowed to reflect that the function checks the current task's cpuset.mems. This allows us to make a new cpuset_node_allowed function that checks a target cgroup's cpuset.mems. Acked-by: Waiman Long Signed-off-by: Gregory Price --- include/linux/cpuset.h | 4 ++-- kernel/cgroup/cpuset.c | 4 ++-- mm/page_alloc.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 835e7b793f6a..893a4c340d48 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -82,11 +82,11 @@ extern nodemask_t cpuset_mems_allowed(struct task_struct *p); void cpuset_init_current_mems_allowed(void); int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask); -extern bool cpuset_node_allowed(int node, gfp_t gfp_mask); +extern bool cpuset_current_node_allowed(int node, gfp_t gfp_mask); static inline bool __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) { - return cpuset_node_allowed(zone_to_nid(z), gfp_mask); + return cpuset_current_node_allowed(zone_to_nid(z), gfp_mask); } static inline bool cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 0f910c828973..f8e6a9b642cb 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -4090,7 +4090,7 @@ static struct cpuset *nearest_hardwall_ancestor(struct cpuset *cs) } /* - * cpuset_node_allowed - Can we allocate on a memory node? + * cpuset_current_node_allowed - Can current task allocate on a memory node? * @node: is this an allowed node? * @gfp_mask: memory allocation flags * @@ -4129,7 +4129,7 @@ static struct cpuset *nearest_hardwall_ancestor(struct cpuset *cs) * GFP_KERNEL - any node in enclosing hardwalled cpuset ok * GFP_USER - only nodes in current tasks mems allowed ok. */ -bool cpuset_node_allowed(int node, gfp_t gfp_mask) +bool cpuset_current_node_allowed(int node, gfp_t gfp_mask) { struct cpuset *cs; /* current cpuset ancestors */ bool allowed; /* is allocation in zone z allowed? */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5079b1b04d49..233ce25f8f3d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3461,7 +3461,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, retry: /* * Scan zonelist, looking for a zone with enough free. - * See also cpuset_node_allowed() comment in kernel/cgroup/cpuset.c. + * See also cpuset_current_node_allowed() comment in kernel/cgroup/cpuset.c. */ no_fallback = alloc_flags & ALLOC_NOFRAGMENT; z = ac->preferred_zoneref; @@ -4148,7 +4148,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask, unsigned int order) /* * Ignore cpuset mems for non-blocking __GFP_HIGH (probably * GFP_ATOMIC) rather than fail, see the comment for - * cpuset_node_allowed(). + * cpuset_current_node_allowed(). */ if (alloc_flags & ALLOC_MIN_RESERVE) alloc_flags &= ~ALLOC_CPUSET; -- 2.49.0