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 D6733C369D6 for ; Tue, 22 Apr 2025 01:26:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD4F96B0007; Mon, 21 Apr 2025 21:26:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A5DBC6B0008; Mon, 21 Apr 2025 21:26:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D5136B000A; Mon, 21 Apr 2025 21:26:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 70F0B6B0007 for ; Mon, 21 Apr 2025 21:26:22 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9AA721A1642 for ; Tue, 22 Apr 2025 01:26:22 +0000 (UTC) X-FDA: 83359939404.29.2371D0D Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by imf01.hostedemail.com (Postfix) with ESMTP id D036540008 for ; Tue, 22 Apr 2025 01:26:20 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=FXNAwhw4; dmarc=none; spf=pass (imf01.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.49 as permitted sender) smtp.mailfrom=gourry@gourry.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1745285180; a=rsa-sha256; cv=none; b=fIHKg0Ifh+WmyuFFY6AineFwqkmLQS3cUkzW8Pr24XvOMIBuZHFYDTJNWZ93IATtzMVNiD jfgJ4wbm8RP0FYLxe9IKWIxToX/F8RMVl5zkUIJnChcgTEseGh8lNKXGFQj5Nbi7JEfe2c 84qOhWnEfeXa6LRPi84R7usmHgRgfyY= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=FXNAwhw4; dmarc=none; spf=pass (imf01.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.49 as permitted sender) smtp.mailfrom=gourry@gourry.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1745285180; 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=G1mPVA4cXPg0N1mX+v1sOAvzy+p3OvMqYnhewp9Uhag=; b=ckYMlzMGEJgWMaDttyw5Ze0yfJ4etqP8DE6O3pu4nPFxrAmQvtZjMZ+6YkI647LqdMEhvB +wjPNkwc+8uC5eH4MnqK82limSkAWfoZ3G4PRjpo8xf0SQhjwVaRndtqyfzDC5dQHmZ4A+ XRar5OBJdg11Swgea/EJe/SVuSBuccY= Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6e8f4c50a8fso44351726d6.1 for ; Mon, 21 Apr 2025 18:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1745285180; x=1745889980; 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=G1mPVA4cXPg0N1mX+v1sOAvzy+p3OvMqYnhewp9Uhag=; b=FXNAwhw4jq/yZTCGyNBL+bV0odnlz0rheKBgFBs1Mbv6B4wcWoMf1GRcQV4XTzUfgg ecrsHJcRJVrNBsE+YSba21CFEpmJ4dTawGkcyojo/xOX+qD3F3VHv3OyK41C85juqD6n oC05tDlnEo2kpJDhkZIYKPBxL2mK4TU3I5bbHj8MnokG2MWa6gthaRutqvKaC5cHPiFb xjTz6vdx2g2DV7AuCgwgG1gL8x783qBSBwHp8J8TsB0eppjl5gWyGDXbdfOkjmtflMd/ eoIRhn0Edu/TT7Y25FPHoPzUB6DuSLEDItnCRJEA4jNtfJScVyx6uNgsAg9T2uKzp+OC /uAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745285180; x=1745889980; 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=G1mPVA4cXPg0N1mX+v1sOAvzy+p3OvMqYnhewp9Uhag=; b=bi4A42Sj61wiDSuxBHjeP2kTYriZWV6roszonPNsVElq0wswPO5HZg6FFPhr4aUXQA XVbnxIdQKDLf0rmu/kCMT25pYGfQA6CcA+KNmFNgImEONJN0Pvk1t0oHlVF23TQkv4sJ Zo6WjW4WrdbnZuxJVQc5QshH59b/gQMg+3N2WKyHh9MZAmXDk8KOWkHxC17I1wwJ8StN 9HAK9FqaHJ1KQPe6r06hOt8JYybZHkyi+lrx4Mzq0mZHRe6mU1cPN8uie7w7k+K01t5T 1adEd/ErNozxJ1DmHL8dbDNZ7/x0w5cg9SwUYEEZ2kq14GfmkiVFjw1mH4u2LIk4WZi7 KiOw== X-Gm-Message-State: AOJu0YyIKZgchkmNrvBfp+g57rKgv/uP861M8+iWcwshxrgFa5NNurEs otcChkGAd57QZpJyFIvzRDeJEWqsJ4CFW8IKbqLHG7OUWZ4Oa7LgrK4Zje1BunPmseOkV1WRc3G i X-Gm-Gg: ASbGncudbDSywj2n9EkUp0vAuWJmWLbH0bE5mxu2fRhpKpSDSYrEC8S/LqOlxn6baw6 bB61OzDrXfSx08tjWaydrlRaNgkSv9eoMMAjNbEkC1Wa9aST3MAPtZKm2J8ioIC9Ts8X48ebTDk 4P4Se60zUzOX813vl2VnLA7+zF1ypxHVwjzSlMiUC9T53Xi2aLBkOWNMc50C16/ox+J7aZSzf7o uQiSaPPuhlZjaAkoWLYAqA3ZnfF9MUvJZoVBoxGCTfVXgIqhBloRnxNlB5wnIgiCicwwnKNoCe0 L83vVsMMTCf6ZqJp8GhDhiaCUElKBokctTt4AyxD3paBnjMOuekCjd0L6MS3Zk2NuK/kPmmKqYd regHqJ0nLOIx8XtdVCiYQ7BS5C6Ly X-Google-Smtp-Source: AGHT+IGPO18DH4WOgXP7cL3OCDqBNIt/HyTq16JBra9RvS5NgW2B0W0WDaXjFUz6XK3UscEHnrDmXg== X-Received: by 2002:a05:6214:5081:b0:6f2:b7d9:689b with SMTP id 6a1803df08f44-6f2c4687f17mr226624926d6.35.1745285179659; Mon, 21 Apr 2025 18:26:19 -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-6f2c2c00d78sm50985746d6.79.2025.04.21.18.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Apr 2025 18:26:19 -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 v4 1/2] cpuset: rename cpuset_node_allowed to cpuset_current_node_allowed Date: Mon, 21 Apr 2025 21:26:14 -0400 Message-ID: <20250422012616.1883287-2-gourry@gourry.net> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250422012616.1883287-1-gourry@gourry.net> References: <20250422012616.1883287-1-gourry@gourry.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: D036540008 X-Stat-Signature: nwa67futwej5grnufugimt4yddjjs5p7 X-Rspam-User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aSgYkJCq0oE9gtXoDmpVDD3MvtEN+p06c6Qx+9fQwShG8izfCfTO7l+RwILkuX4dJ+XCMJ4Ji66egOSvDcV9kLA1Xg37O52B6QYMqpVrevj+5zaKR9HM/WCoUayVkDxPnPjbAFuLfqMCTHtlit6KQWo9J3INNCSnV2xabCQS2scEiKUzjCWzH46DfrJoK7ZbUsi9/uaI4Gs9iOjxh91W4nphv0hGZ6oR2tCNgjsaYue3w5a7y/b3lgfDEd1sy0CH3xpwg+XtzK8/I2BQqBodABrOwQb/lNuzcyKKWjWYENW7Y/9Pz35d1w9Z8wxsQBAr0B+UwXwz/FZRbQIWRo= 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 Acked-by: Tejun Heo Reviewed-by: Shakeel Butt 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