From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 55AC2389104; Wed, 30 Sep 2026 17:00:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790787637; cv=none; b=K8MMZX0hjaZ0fN8FU/WT41qsr/2RMqq4qWRGyLhb5soqMvIE+harDruHnhcqUCgLVMuE8CNBK850XXMA07XqaVJzidPDcqG4+mNJ0+erM1csD0l0mm/D0+Ft+SItjtMepew/gRz/R5CNtN4w6cA0xDLkRNIHY04dqzO1PiT0CKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790787637; c=relaxed/simple; bh=5v2EsH+lzIhqncvytRaRa2YeWnQefR0xNrLsA+tAruA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mYFjTIcbBOwW1drEQSl1cYYFDR3lwc4qDhxJvyww1es/7tmRUhbL7l4xShLbeObimvshe66QVC2ujScF4AvXWCUAcai4IHqQHpLzNj9/0Ay5ZQBgF7XiulTb6SkXtrqFYAvuyMowazPJVXaGk2Nhwd+hdPESga1tx3owitv6B2M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=M4d+yj8C; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="M4d+yj8C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC0291F000FF; Wed, 30 Sep 2026 17:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790787636; bh=qBUj5ZGb4S74vh57M1ohbWFgJs1GvCQbT4wWWNAPklQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=M4d+yj8CMTI/dum8JvKHbaDOg5MDnpOgziTCYf7W0S1w4ct+qcQP1/6FufbxUqSD4 dbiJVGmHGNjy1Mf3pCd5SyisidSpEwnP/WtFc6Enw+mx0TvAi8okW1/2GveVE3tz0H uPApXmoYaw/XZCXqPAQ5GDYoet/CJ16ZTmFowaBY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guopeng Zhang , Tejun Heo Subject: [PATCH 7.2 255/457] cgroup/pids: Restore pids.events notifications in local mode Date: Wed, 30 Sep 2026 17:26:00 +0200 Message-ID: <20260930152351.551336010@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152346.024115587@linuxfoundation.org> References: <20260930152346.024115587@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guopeng Zhang commit 1765a153d985c231357145e26798f9408db10e42 upstream. A fork rejected by the pids controller increments the counter reported by pids.events. When local event accounting is selected, however, pids_event() returns after notifying only events_local_file, leaving pids.events pollers asleep. On legacy hierarchies, pids.events.local does not exist. With pids_localevents, pids.events reports the same local counter. In both cases, pids.events changes without generating a notification. This can be reproduced with a pids_localevents mount: mkdir /tmp/test mount -t cgroup2 -o pids_localevents none /tmp/test mkdir /tmp/test/t echo 1 > /tmp/test/t/pids.max cat /tmp/test/t/pids.events # max 0 timeout 3 inotifywait -e modify /tmp/test/t/pids.events & sh -c 'echo $$ > /tmp/test/t/cgroup.procs; (true &)' 2>/dev/null wait cat /tmp/test/t/pids.events # max 1 Without this patch, inotifywait times out without reporting an event. Notify pids.events before returning from the local event path. Fixes: 3f26a885a068 ("cgroup/pids: Add pids.events.local") Cc: stable@vger.kernel.org # v6.11+ Signed-off-by: Guopeng Zhang Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- kernel/cgroup/pids.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/kernel/cgroup/pids.c +++ b/kernel/cgroup/pids.c @@ -253,6 +253,11 @@ static void pids_event(struct pids_cgrou } if (!cgroup_subsys_on_dfl(pids_cgrp_subsys) || cgrp_dfl_root.flags & CGRP_ROOT_PIDS_LOCAL_EVENTS) { + /* + * pids.events reports the local counter on legacy hierarchies + * and when pids_localevents is enabled. + */ + cgroup_file_notify(&p->events_file); cgroup_file_notify(&p->events_local_file); return; }