From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=90.155.92.199 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796025539; b=HH2ksTH0qhd7tgxagAR8V+QC5kyu71Pxmi7HKAnIYy56+LG7YCxQhkikQPuH6b1Q/0mY qsPWZBKh8kVqjqxA+0yM8GHczjlSEPhlFAWvb+RT1fpPqjeh2DDRuKoy8BVZ4LK+Gc7XI EHb83MRh/E1yobjX9coitsO8ca/p5JZxgGH4hCiOvddQWnq7bFI1mIqlS5as0EgicHk8L W37nicVr4KaztBcmhvq6czmtdhIarbAHiImHcHBha9nbV5Q9vJRb1g51yH66P3OUsG4lD EwmOQU1/AQvsBMriOM2IZRxN12dOswRclwCBjGTdHv6ZGanuMHgMJjxmdD2Vg6pOYrw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796025539; h=DMARC-Filter:DKIM-Signature:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=3vvdRBONTrbSjuEcC1RXcHZkHfPgjqiCOrbfbobesCU=; b=F6SaphXopRXwrdrjvYpeP5gcr1JKR2GVIj77z8M+HyLb77qD/RGnicvVIt7eyOMBOTJg Tyq5EZ434Ws/89E/0b5D77RdfpSJrLdVqRLGYZzabkW3sKanWCtRxI6wDYJJJQW2o1Z93 Avoimerc7YeibQjeNdzl0QDWERGSG6pL1dH1vRUqbgIsJF4Tpgr6Q+uwH4R3mpow/JZSc ZGOu0c9oyMQ99A1R5pugjBT48Fe/9x22zeLSTOG4IUuUlhVGLM3dqbykPskM3ByO6OvMH IaLNwg6ggV303KRBnWN4B4y+33R7UBj71jS9z+c1UAPDQon0qe8b6RLgz44sXetffJA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=d9T0uKWZ; arc=none smtp.remote-ip=90.155.92.199 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DADCA606A338; Mon, 30 Nov 2026 07:58:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DADCA606A338 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=d9T0uKWZ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3vvdRBONTrbSjuEcC1RXcHZkHfPgjqiCOrbfbobesCU=; b=d9T0uKWZ5JytocPkeWtAfnO809 t2lB9eypzxNcsR1w1nKSDvaEoMGwzUEsXB2pzwJz/Kg0KSvYwjR3hCFMflVuLyEeRMi3eRbV6blB5 EAZMN4zDRuCpOUmfQv4kf8Y+0jzfrC+/oTVXVubcn95yf/5K06m1Dl1SdQGTgKv7CFKAbVh3P6bB5 JKDmGuAu54wcyA4JNtC3sPclHUnlEfFSbVIl+U7wRw7MgB9TzQQiiHcfxpRJScU+C/19dl4PGgUhU dHCqUg4RAJdU45vXXSueZAzlUSppug0jc8KShXQeLmToGyNolKkUcvNZxfxDz30yX4+n8bMsPNisC zd3wsdhQ==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXwHc-00000009e6d-2JP4; Mon, 30 Nov 2026 07:58:44 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 6A041303045; Mon, 30 Nov 2026 08:58:42 +0100 (CET) Date: Mon, 30 Nov 2026 08:58:42 +0100 From: Peter Zijlstra To: Chris Down Cc: Greg Kroah-Hartman , Tejun Heo , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Serge Hallyn , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Yonghong Song , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , driver-core@lists.linux.dev, cgroups@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, sashiko-bot@kernel.org Subject: Re: [PATCH v3 2/3] sched/debug: Drop the "..." suffix from truncated group paths Message-ID: <20261130075842.GI2668804@noisy.programming.kicks-ass.net> References: X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Nov 29, 2026 at 07:48:20PM -0800, Chris Down wrote: > When another reader holds sched_debug_lock, > SEQ_printf_task_group_path() builds the group path in a 128 byte buffer > on the stack, and writes "..." over the end of it in case the path > filled it. Since the previous commit, cgroup_path() keeps the end of a > path which doesn't fit and puts "..." at its start, so a long path now > prints with "..." at both ends, which suggests the end was cut off when > it wasn't. > > Let's drop the suffix and leave marking the truncation to cgroup_path(). > > Signed-off-by: Chris Down So truncated paths now look like: "...oo/bar", rather than "/foo/b..." ? Acked-by: Peter Zijlstra (Intel) > --- > kernel/sched/debug.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c > index e6a3b516c703..328db4809780 100644 > --- a/kernel/sched/debug.c > +++ b/kernel/sched/debug.c > @@ -941,9 +941,7 @@ static void task_group_path(struct task_group *tg, char *path, int plen) > /* > * Only 1 SEQ_printf_task_group_path() caller can use the full length > * group_path[] for cgroup path. Other simultaneous callers will have > - * to use a shorter stack buffer. A "..." suffix is appended at the end > - * of the stack buffer so that it will show up in case the output length > - * matches the given buffer size to indicate possible path name truncation. > + * to use a shorter stack buffer. > */ > #define SEQ_printf_task_group_path(m, tg, fmt...) \ > { \ > @@ -953,9 +951,7 @@ static void task_group_path(struct task_group *tg, char *path, int plen) > spin_unlock(&sched_debug_lock); \ > } else { \ > char buf[128]; \ > - char *bufend = buf + sizeof(buf) - 3; \ > - task_group_path(tg, buf, bufend - buf); \ > - strcpy(bufend - 1, "..."); \ > + task_group_path(tg, buf, sizeof(buf)); \ > SEQ_printf(m, fmt, buf); \ > } \ > } > -- > 2.56.1 >