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 3B539405C5F for ; Tue, 19 May 2026 10:19:37 +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=1779185978; cv=none; b=sqWkb1t+SZ+JeDVEKZD4JOC7SBpY8Sg9Xn7uiz+/g9ZFoTx+4NPC3o3lzQRkOhMT0ifszk3WbRAz8NUULxwxGG/runKY5j2DoKSmDDwl4B0OhlqgAhFIqEIDXo4ikmwHjhBLc+LfRf/04x6nfz/rsGT0o2mv5UO6kqHg9gE2rbI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779185978; c=relaxed/simple; bh=R6ulmIWrQA2HYo8D1d948fU8pjUir4ZrY00bzJN9k6E=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=qHcUXRa7MWKRtEOCQF0flkhQiHW/aXja+N2c/GXbIFFb6RmEj+ff/Hrf0GXz0Lshp9RNG9rRCdP2CYP0F2EBeR/0a0PsfM0ZIhIfkhDHBKS0nsyYwVjszrqsVGGhgL3ntKqztrcLP0sJpqgmiA0EDrMx7DGoUxFEW5M8a1k+4Ps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=toADC5xz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="toADC5xz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E659C2BCC6; Tue, 19 May 2026 10:19:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1779185977; bh=R6ulmIWrQA2HYo8D1d948fU8pjUir4ZrY00bzJN9k6E=; h=Subject:To:Cc:From:Date:From; b=toADC5xzwYuSdKXWbRL5Ny6s+1Hcm+S4IB2QRCO+prechWuNS1g3hjeXH0JNMBuuL ecsYZadtA15zr8/KbN8wFGpUM1MWF3s0YCFuuJr3fK1FDBUjllXJaS/IpsBOgU+Rhg n3X+pb33HnQfLeUFodJQDe3E1P68+tqz+JTSX3tI= Subject: FAILED: patch "[PATCH] cgroup/cpuset: Reset DL migration state on can_attach()" failed to apply to 6.18-stable tree To: zhangguopeng@kylinos.cn,chenridong@huaweicloud.com,longman@redhat.com,tj@kernel.org Cc: From: Date: Tue, 19 May 2026 12:18:50 +0200 Message-ID: <2026051950-charbroil-unbutton-3311@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 4a39eda5fdd867fc39f3c039714dd432cee00268 # git commit -s git send-email --to '' --in-reply-to '2026051950-charbroil-unbutton-3311@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From 4a39eda5fdd867fc39f3c039714dd432cee00268 Mon Sep 17 00:00:00 2001 From: Guopeng Zhang Date: Sat, 9 May 2026 18:20:30 +0800 Subject: [PATCH] cgroup/cpuset: Reset DL migration state on can_attach() failure cpuset_can_attach() accumulates temporary SCHED_DEADLINE migration state in the destination cpuset while walking the taskset. If a later task_can_attach() or security_task_setscheduler() check fails, cgroup_migrate_execute() treats cpuset as the failing subsystem and does not call cpuset_cancel_attach() for it. The partially accumulated state is then left behind and can be consumed by a later attach, corrupting cpuset DL task accounting and pending DL bandwidth accounting. Reset the pending DL migration state from the common error exit when ret is non-zero. Successful can_attach() keeps the state for cpuset_attach() or cpuset_cancel_attach(). Fixes: 2ef269ef1ac0 ("cgroup/cpuset: Free DL BW in case can_attach() fails") Cc: stable@vger.kernel.org # v6.10+ Signed-off-by: Guopeng Zhang Signed-off-by: Tejun Heo Reviewed-by: Chen Ridong Reviewed-by: Waiman Long diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index a48901a0416a..3fbf6e7f68c3 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -3050,16 +3050,13 @@ static int cpuset_can_attach(struct cgroup_taskset *tset) int cpu = cpumask_any_and(cpu_active_mask, cs->effective_cpus); if (unlikely(cpu >= nr_cpu_ids)) { - reset_migrate_dl_data(cs); ret = -EINVAL; goto out_unlock; } ret = dl_bw_alloc(cpu, cs->sum_migrate_dl_bw); - if (ret) { - reset_migrate_dl_data(cs); + if (ret) goto out_unlock; - } cs->dl_bw_cpu = cpu; } @@ -3070,7 +3067,10 @@ static int cpuset_can_attach(struct cgroup_taskset *tset) * changes which zero cpus/mems_allowed. */ cs->attach_in_progress++; + out_unlock: + if (ret) + reset_migrate_dl_data(cs); mutex_unlock(&cpuset_mutex); return ret; }