linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Auld <pauld@redhat.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] sched: Mention autogroup disabled behavior
Date: Thu, 16 Jan 2025 09:14:45 -0500	[thread overview]
Message-ID: <20250116141445.GB7382@pauld.westford.csb> (raw)
In-Reply-To: <bpbyx7d567ctpoqutwy2sk6dh7xsilrglnkoomcfgrtrqtjwtl@tajyt523goqu>

On Thu, Jan 16, 2025 at 02:59:20PM +0100 Alejandro Colomar wrote:
> Hi Phil,
> 
> On Thu, Jan 16, 2025 at 08:53:15AM -0500, Phil Auld wrote:
> > 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?
> 
> Both.  :)
> 
> The more information we have in the commit message, the better (in case
> someone needs to check in the future, that will give more context).
>

Okay, fair enough. Will do.  It was just hard for me to show that the
listed autogroup is not really being used. 

I'll put the above in there and send v2.

Thanks!

Cheers,
Phil


> 
> Cheers,
> Alex
> 
> -- 
> <https://www.alejandro-colomar.es/>



-- 


      reply	other threads:[~2025-01-16 14:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 12:46 [PATCH v1] sched: Mention autogroup disabled behavior Phil Auld
2025-01-16 13:06 ` Alejandro Colomar
2025-01-16 13:53   ` Phil Auld
2025-01-16 13:59     ` Alejandro Colomar
2025-01-16 14:14       ` Phil Auld [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250116141445.GB7382@pauld.westford.csb \
    --to=pauld@redhat.com \
    --cc=alx@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).