From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 DA9CB30E0D6 for ; Mon, 5 Jan 2026 03:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767585585; cv=none; b=PR6QgcHpSyRHm0v6gvtdv39gfWVzpYKBPyd4lxe1LQVUPPFWoxdwktUFKSXn/Pwr5LI2hQavLgVMedZqEoOiNidrrVSC6l8z+FApW+tj2lXkvrLlgnnZzAFM7uNl0IulEphL6GS5ikYr3SQHqP5KsE34z2V/B5aOy2ooCC6UTog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767585585; c=relaxed/simple; bh=i14d6bDqTphWg0tcgZQtxI4oehvWUN5DxtfPLeQ9Xek=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=lyN85vBU9PS3PsW9leKAAGe0ZMcjdBcOyw1m725K7FcjEgC4JhxFKgKMrANw4e1zdEI2YohD13E6g4ComWT/HA7kawffLJ3OCCioGKAbwIHugep9JWe4fM8M3qSgETObKElLz7BCoLTP58nH+b7tneE7q2TASTxFYun8do4wLtg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KG6FkaiW; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=U38+v2s/; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KG6FkaiW"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="U38+v2s/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767585582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DcstfgGe6NPr6oxFWbPA0cQo82UVim7d++fhOcCLZtk=; b=KG6FkaiWbUeD388iwr9GLoxaLEPe3IOy5EndZL4lRaWrJU5MkSFL+SlAQtRLP82KwbJMZ4 UtHj5ZcfmgGPWvTwBOQBmdejnYc7B+JUSzADYKEfu9BolFifA2S3gTgtmAtbHk1/fVjq7v VLaPsUWXECtNajnpg9UAgvKl7TF630E= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-196-eDlbhHHIOdeUxjOaZnYH5g-1; Sun, 04 Jan 2026 22:59:41 -0500 X-MC-Unique: eDlbhHHIOdeUxjOaZnYH5g-1 X-Mimecast-MFC-AGG-ID: eDlbhHHIOdeUxjOaZnYH5g_1767585581 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-4ed79dd4a47so313360121cf.3 for ; Sun, 04 Jan 2026 19:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1767585581; x=1768190381; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:from:to :cc:subject:date:message-id:reply-to; bh=DcstfgGe6NPr6oxFWbPA0cQo82UVim7d++fhOcCLZtk=; b=U38+v2s//8MK9WHZltDfz1riArl6GWWIUp399Ay3PGC00g+h1Msgy55419Ni2N+qGm yuq0vyNrRTF9kbkD3zMlYVbNzbNs26fhVXcxMznuPyCmIjdC4PdGPqbWXkvYSYUxswUj NOqbYPTzZmkzKCLpKO+tTGdMKBZ0iQIXupptywrOl97whjOR3uOyCK6CCjCekU45ycXm 7oqwIK+W1kIYuji0zM6TzkIS6c4+SGXrJt/B5J1CL6zToOxkcnjhiZGjttn3WrR6NwLH MbqC5zQmCgmwx1WVeipYjnbfY+/pDuyCUfx2pn2EAkDW/6WexRPj9y8UH+iI4JVYfEp9 IK/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767585581; x=1768190381; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DcstfgGe6NPr6oxFWbPA0cQo82UVim7d++fhOcCLZtk=; b=lXrKPjcPuU1KEKMz49YJhHY0n5UevbB9JwlUtae4gLCoQee7Xmlvx+H/mzHV6RtM9A eN4ocyCWqc54iZ+LTYWGINaChtdFtg1pF49Pqz3fxVllU3bZeeTi9Kua54rv/VdaSIYI COIuKJwFFpp3/wVG3wXcW7awvijJAq4+VuGX2UHk+bCh7azfTyVnSkP2d0yrIwACZCqT OlFLkXbfJL0MdXktpXe9HXrQQpvzMFuwc+Khxbi0CBkEnZ1nCFzNjJeGk0YxQwZraZSo yp0gaFHx8RTLZD9PJw7T9/lkk0q7k/lnUPTOdTU22+ERjGpPp8ArcsaMu0FIwclZ/4cF Ol/A== X-Gm-Message-State: AOJu0YyXFCgaoS4+MVY5tYAbDysLMQluy9OU8QwYkiSNLwpVamlK509D xQmp3leypjdmZ7dSlv3P2KpfYZGvOz9PsvPNd1Iqgyzalhj7U9Fw6k7s0LpmYtZzSeMKXG3Mo16 M5mk9ukqCeivHP7POYtJsG70sJgoSLmir5ruUlqQeAPyG7k3O12E/FUDE0b2ifMz1WQ== X-Gm-Gg: AY/fxX5mZEkk5EQuFIikzXvNgwbPscZwpU7ntMp8eQ9fxiYT1I++TlkE92dMlwZ/8x+ Jqi9T7TZ8OKcnTAMvy4Zq+wkYQvas+vZW9CARkYNSAPrdMR+6YLMcoXnyaN3nkL2jjg5H3hshKU 4Nl+R9r+ho9kmUKnrDBTBxEsHuFPBW/U02EcVSYhH+Sd7YdKxAj3kGm5GYR5cFzeAtxcFcluh2F 2IbF+BO8bhW2UIFQeeWh3Z8Z0upIWkYvCnD/8u0C866WobxNaYApNokkBB4ewlsyxh1Kqww7Lkw EC5Bd1Va5p8cyBqepr+AWeP6hZhK1iccYcLUd8QOBtqPLUwMiLKa7bu8SeRtHmdeBozG0cZtd3l U86bmGr2trZJuc3Qr8/QZ8x2zygjabMZ3iRAvYj3K3UjGGg8E4kw/oaNJ X-Received: by 2002:ac8:6f0f:0:b0:4f0:2d78:b955 with SMTP id d75a77b69052e-4f4abd797f1mr748971271cf.53.1767585581003; Sun, 04 Jan 2026 19:59:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+NcyGeeiQSa4IIGkUpR94ZHm/A+yiFKrXcCzGbDEBp1p4GQ6FxU+mKwmroOKv1AZgBlIG4w== X-Received: by 2002:ac8:6f0f:0:b0:4f0:2d78:b955 with SMTP id d75a77b69052e-4f4abd797f1mr748971071cf.53.1767585580638; Sun, 04 Jan 2026 19:59:40 -0800 (PST) Received: from ?IPV6:2601:188:c102:b180:1f8b:71d0:77b1:1f6e? ([2601:188:c102:b180:1f8b:71d0:77b1:1f6e]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4f4ac530f0dsm339626871cf.3.2026.01.04.19.59.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Jan 2026 19:59:39 -0800 (PST) From: Waiman Long X-Google-Original-From: Waiman Long Message-ID: <85f4bca2-e355-49ce-81e9-3b8080082545@redhat.com> Date: Sun, 4 Jan 2026 22:59:38 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [cgroup/for-6.20 PATCH v2 3/4] cgroup/cpuset: Don't fail cpuset.cpus change in v2 To: Chen Ridong , Waiman Long , Tejun Heo , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Jonathan Corbet , Shuah Khan Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Sun Shaojie References: <20260101191558.434446-1-longman@redhat.com> <20260101191558.434446-4-longman@redhat.com> <6eedf67b-3538-4fd1-903b-b7d8db4ff43d@redhat.com> <7a3ec392-2e86-4693-aa9f-1e668a668b9c@huaweicloud.com> Content-Language: en-US In-Reply-To: <7a3ec392-2e86-4693-aa9f-1e668a668b9c@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/4/26 8:35 PM, Chen Ridong wrote: > > On 2026/1/5 5:48, Waiman Long wrote: >> On 1/4/26 2:09 AM, Chen Ridong wrote: >>> On 2026/1/2 3:15, Waiman Long wrote: >>>> Commit fe8cd2736e75 ("cgroup/cpuset: Delay setting of CS_CPU_EXCLUSIVE >>>> until valid partition") introduced a new check to disallow the setting >>>> of a new cpuset.cpus.exclusive value that is a superset of a sibling's >>>> cpuset.cpus value so that there will at least be one CPU left in the >>>> sibling in case the cpuset becomes a valid partition root. This new >>>> check does have the side effect of failing a cpuset.cpus change that >>>> make it a subset of a sibling's cpuset.cpus.exclusive value. >>>> >>>> With v2, users are supposed to be allowed to set whatever value they >>>> want in cpuset.cpus without failure. To maintain this rule, the check >>>> is now restricted to only when cpuset.cpus.exclusive is being changed >>>> not when cpuset.cpus is changed. >>>> >>> Hi, Longman, >>> >>> You've emphasized that modifying cpuset.cpus should never fail. While I haven't found this >>> explicitly documented. Should we add it? >>> >>> More importantly, does this mean the "never fail" rule has higher priority than the exclusive CPU >>> constraints? This seems to be the underlying assumption in this patch. >> Before the introduction of cpuset partition, writing to cpuset.cpus will only fail if the cpu list >> is invalid like containing CPUs outside of the valid cpu range. What I mean by "never-fail" is that >> if the cpu list is valid, the write action should not fail. The rule is not explicitly stated in the >> documentation, but it is a pre-existing behavior which we should try to keep to avoid breaking >> existing applications. >> > There are two conditions that can cause a cpuset.cpus write operation to fail: ENOSPC (No space left > on device) and EBUSY. > > I just want to ensure the behavior aligns with our design intent. > > Consider this example: > > # cd /sys/fs/cgroup/ > # mkdir test > # echo 1 > test/cpuset.cpus > # echo $$ > test/cgroup.procs > # echo 0 > /sys/devices/system/cpu/cpu1/online > # echo > test/cpuset.cpus > -bash: echo: write error: No space left on device > > In cgroups v2, if the test cgroup becomes empty, it could inherit the parent's effective CPUs. My > question is: Should we still fail to clear cpuset.cpus (returning an error) when the cgroup is > populated? Good catch. This error is for v1. It shouldn't apply for v2. Yes, I think we should fix that for v2. Cheers, Longman