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 822DB143736 for ; Thu, 16 Jan 2025 13:53:23 +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=1737035605; cv=none; b=tyahRxZ27yjrNBxgA580o/LaqqtN/AzaJ4aWEgpD8yF0eHc/mSXdXY6bRHv32PrreIg4sCy1sYSCGGIazksSgc5oZn1TOTdaCVGMAbinpd63Y0GpWu3ilcwdwyJO/kR+YAacsLrto3ubdPX6z0Zkf0JEOGkVoGnwbcegEOpMS5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737035605; c=relaxed/simple; bh=wmeK+x31fgQOntbVBELH4RC6E7ISnX10fIUdQTdtShs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FsFLGDIvi0/MdM32qRAuLL3Jm/VqtZezcecT826B8T0ZkTi4ZZ0mdtI1a0cySm4JfMhzL4lD23ijEN78ow8r7xp+n5ooJgbToQfQqeEwXrY1VIEOaU23qjPcEvlqGBFw1GQOFekeEwHn/2/ZFtKdAGRXwvaUvHmjExgRcY/FkQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=Ys2Sp4d9; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="Ys2Sp4d9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737035602; 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: in-reply-to:in-reply-to:references:references; bh=jAdVDm5NdFDEKpFKfNgSNDYrigR/18CFKVSUR7QVf3c=; b=Ys2Sp4d9lF0dtTtkYeL95s11MqrJ2zUcB6FqNVUllpUObWKwCHXrSbkAUZEw7ifGUbvgBZ AjVohug21a4FwXVmbATuHdbIY5dAlRjyS8Abw26lYwAVA8njBoxjinyfroSHbIjQ+YOz5L QUN+6cxA0dAVPItSy6MkZ5gPOvTFloM= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-342-jChqN-SuNXeYiaTM38zH7w-1; Thu, 16 Jan 2025 08:53:20 -0500 X-MC-Unique: jChqN-SuNXeYiaTM38zH7w-1 X-Mimecast-MFC-AGG-ID: jChqN-SuNXeYiaTM38zH7w Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3A9601955D80; Thu, 16 Jan 2025 13:53:19 +0000 (UTC) Received: from pauld.westford.csb (unknown [10.22.88.147]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3F79E3003E7F; Thu, 16 Jan 2025 13:53:17 +0000 (UTC) Date: Thu, 16 Jan 2025 08:53:15 -0500 From: Phil Auld To: Alejandro Colomar Cc: linux-man@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] sched: Mention autogroup disabled behavior Message-ID: <20250116135315.GA7382@pauld.westford.csb> References: <20250116124654.2365691-1-pauld@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Hi Alejandro, On Thu, Jan 16, 2025 at 02:06:26PM +0100 Alejandro Colomar wrote: > Hi Phil, > > > Subject: sched: Mention autogroup disabled behavior > > Please use the pathname of the modified file as a prefix: > > man/man7/sched.7: Mention autogroup disabled behavior ack > > On Thu, Jan 16, 2025 at 12:46:54PM +0000, Phil Auld wrote: > > The autogroup feature can be contolled at runtime when > > built into the kernel. Disabling it in this case still > > creates autogroups and still shows the autogroup membership > > for the task in /proc. The scheduler code will just not > > use the the autogroup task group. > > Would you mind showing (in the commit message) a shell session that > demonstrates this? This is actually part of the problem. It's very hard to see this from userspace. I can show a shell session that shows that autogroup is disabled and that my task has an autogroup in /proc but determining that the autogroup is not being used not so much. (I may be missing something obvious but I could not find it). I had to look at the kernel code: kernel/sched/autogroup.h: static inline struct task_group * autogroup_task_group(struct task_struct *p, struct task_group *tg) { extern unsigned int sysctl_sched_autogroup_enabled; int enabled = READ_ONCE(sysctl_sched_autogroup_enabled); if (enabled && task_wants_autogroup(p, tg)) return p->signal->autogroup->tg; return tg; } bool task_wants_autogroup(struct task_struct *p, struct task_group *tg) { if (tg != &root_task_group) return false; ... } The former being called from sched_group_fork() and sched_get_task_group(). I suppose looking at /proc/pid/cgroup and seeing it report not "0::/" is part of it since it then won't be in root task group. To some extent any systemd based system these days is not really using autogroup at all anyway. I can put some of the above in there or just something like: # cat /proc/sys/kernel/sched_autogroup_enabled 0 # cat /proc/$$/autogroup /autogroup-112 nice 0 Thoughts? Cheers, Phil > > > This can be confusing > > to users. Add a sentence to this effect to sched.7 to > > point this out. > > > > Signed-off-by: Phil Auld > > To: Alejandro Colomar > > Cc: > > Cc: LKML > > Thanks! > > > > > --- > > man/man7/sched.7 | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/man/man7/sched.7 b/man/man7/sched.7 > > index 71f098e48..f0a708cd7 100644 > > --- a/man/man7/sched.7 > > +++ b/man/man7/sched.7 > > @@ -724,6 +724,8 @@ in the group terminates. > > .P > > When autogrouping is enabled, all of the members of an autogroup > > are placed in the same kernel scheduler "task group". > > +When disabled the group creation happens as above, and autogroup membership > > s/disabled/&,/ > > Also, please use semantic newlines. See man-pages(7): > > $ MANWIDTH=72 man man-pages | sed -n '/Use semantic newlines/,/^$/p' > Use semantic newlines > In the source of a manual page, new sentences should be started on > new lines, long sentences should be split into lines at clause > breaks (commas, semicolons, colons, and so on), and long clauses > should be split at phrase boundaries. This convention, sometimes > known as "semantic newlines", makes it easier to see the effect of > patches, which often operate at the level of individual sentences, > clauses, or phrases. > > > Have a lovely day! > Alex > > > +is still visible in /proc, but the autogroups are not used. > > The CFS scheduler employs an algorithm that equalizes the > > distribution of CPU cycles across task groups. > > The benefits of this for interactive desktop performance > > -- > > 2.47.0 > > > > -- > --