From nobody Tue Sep 29 06:58:38 2026 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 5391C3AEB5C for ; Tue, 11 Aug 2026 08:31:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786437098; cv=none; b=ATz2/XunZi2kO/HiUCT5gnMbAQELDlR8SQYvg/J56/BjGwkwHr/mjZ7xeRYv6LCYLyTpgnZ65ratr8L1xGbtkU6IXVB7m1QLhDZvJoXiYzp8DsBA/Hj6VvOUODYfZnV9t2gX5CIb6DZCm9bnz0IRZbAjIiJKmZzSWWf3W6AFeVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786437098; c=relaxed/simple; bh=uMBvMqDFHkv5Dbt1COLIOPk1VgUYUW3xk1ZHUhoyiZ0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fUquCXd0zVytLRuh1KFTML88ytD22xT4F3qH9xwx4imchotbDcvs9rB0qXH+XZwbUErbVFWcnst8Bfcrhgw6Fjcoy89FUGTXOmHu5MOrZua0jYpC/LppuVDGmSXZiCRQKpYsynR0ek5B8Yh/NvzoHRgt4G3plPg/Jq5ffJ3CG4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ZsBBGFQm; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ZsBBGFQm" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786437084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=QSwpnUN82TaJRirbgvxNKqzW9uVPfe1inAZ+MwxZbN8=; b=ZsBBGFQm8uheiLcFdFApBtmIncyZk5YuODbMikRFMMiGSXX1P5oJVihVp5RtUYzZZpfu6e CDgQ+nyWjZ9jNHVw/wDuLMoDcK0vkM81qbTL3h4HfTXSWrJrQxLAzj6MkbCEtI9i/KmYHx vV/wOEitLxA8/xpaQvbWKlofeG7B5z4= From: Guopeng Zhang To: longman@redhat.com, ridong.chen@linux.dev, cgroups@vger.kernel.org Cc: tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, peterz@infradead.org, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, zhangguopeng@kylinos.cn Subject: [PATCH v2] cgroup/cpuset: Remove obsolete PFA_SPREAD_SLAB task flag Date: Tue, 11 Aug 2026 16:30:27 +0800 Message-ID: <20260811083027.140577-1-guopeng.zhang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Guopeng Zhang Commit 16a1d968358a ("mm/slab: remove mm/slab.c and slab_def.h") removed the SLAB allocator, the only allocator that implemented cpuset slab spreading. Commit 61a182ab61a6 ("cgroup/cpuset: Remove cpuset_do_slab_mem_spread()") then removed the last task_spread_slab() caller. Commit 3ab67a9ce82f ("cgroup/cpuset: Mark memory_spread_slab as obsolete") marked the legacy control obsolete. cpuset still updates PFA_SPREAD_SLAB when tasks attach to a legacy cpuset and walks all tasks in a cpuset when memory_spread_slab changes. Remove the unused task flag and its helpers, and make spread task updates depend only on memory_spread_page. Keep the memory_spread_slab control and CS_SPREAD_SLAB state so legacy users retain the existing write, readback and inheritance behavior. Update the comments and documentation to describe only page-cache spreading as functional. Assisted-by: LLM Signed-off-by: Guopeng Zhang Reviewed-by: Waiman Long flags =3D trialcs->flags; @@ -2895,7 +2894,7 @@ int cpuset_update_flag(cpuset_flagbits_t bit, struct = cpuset *cs, rebuild_sched_domains_locked(); } =20 - if (spread_flag_changed) + if (spread_page_changed) cpuset1_update_tasks_flags(cs); out: free_cpuset(trialcs); @@ -4484,14 +4483,10 @@ void cpuset_nodes_allowed(struct cgroup *cgroup, no= demask_t *mask) * cpuset_spread_node() - On which node to begin search for a page * @rotor: round robin rotor * - * If a task is marked PF_SPREAD_PAGE or PF_SPREAD_SLAB (as for - * tasks in a cpuset with is_spread_page or is_spread_slab set), - * and if the memory allocation used cpuset_mem_spread_node() - * to determine on which node to start looking, as it will for - * certain page cache or slab cache pages such as used for file - * system buffers and inode caches, then instead of starting on the - * local node to look for a free page, rather spread the starting - * node around the tasks mems_allowed nodes. + * If a task is marked PFA_SPREAD_PAGE and a page cache allocation uses + * cpuset_mem_spread_node() to determine where to start looking, spread the + * starting node around the task's mems_allowed nodes instead of starting = on + * the local node. * * We don't have to worry about the returned node being offline * because "it can't happen", and even if it did, it would be ok. --=20 2.43.0