public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: dhaval@linux.vnet.ibm.com, kaber@trash.net, mingo@elte.hu,
	linux-kernel@vger.kernel.org, bharata@linux.vnet.ibm.com,
	vatsa@linux.vnet.ibm.com, balbir@in.ibm.com
Subject: Re: asterisk hangs with RT priority
Date: Thu, 25 Dec 2008 08:52:07 +0100	[thread overview]
Message-ID: <1230191527.9487.262.camel@twins> (raw)
In-Reply-To: <E1LFbsj-0008WU-Gp@gondolin.me.apana.org.au>

On Thu, 2008-12-25 at 09:07 +1100, Herbert Xu wrote:
> Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> >
> > So you have uid-group scheduling and RT-group scheduling enabled (a
> > feature that's experimental for real and has never been enabled by
> > default), looking at the sys_setuid() code, the real uid change is done
> > by switch_uid() and that doesn't have a failable scheduler hook.
> 
> An experimental marking is no excuse for being broken.

True, and we strive to fix them -- so thanks for finding this one.

> > The thing is, I suspect the uid you switch to doesn't have a RT runtime
> > quota configured, therefore the RT task that gets placed in it by
> > switch_uid() doesn't get to run.
> > 
> > [ Please read Documentation/scheduler/sched-rt-group.txt
> >  when you enable RT group scheduling ]
> 
> This seems broken to me.  The only way for a process to get into
> RR mode is if it had been set by someone with the right privileges
> or if it was inherited from its parent.
> 
> So having a default where such a process stops executing altogether
> after performing a setuid is wrong.

True, therefore the setuid must fail.

> The default should be to give each user a non-zero allotment.

That's sadly impossible. The thing is, you cannot over-commit this time
-- nor change an active configuration. So the only possibility left is a
default of 0.

> > The correct thing would be for switch_uid() (or set_user) to fail with
> > -EINVAL, much like cpu_cgroup_can_attach() currently does for cgroup
> > grouping.
> > 
> > After that it demonstrates a bug in your test program, which fails to
> > check errors ;-)
> 
> Well the program which this was based on, asterisk does check for
> errors on setuid.  However, even if setuid did return an error this
> isn't much better than the status quo since the user will be left
> with the question "why on earth is asterisk failing on setuid?".

Maybe a more descriptive error like -ENOTIME ?


      reply	other threads:[~2008-12-25  7:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-18 16:10 asterisk hangs with RT priority Patrick McHardy
2008-05-20  9:59 ` Patrick McHardy
2008-12-24 11:36 ` Herbert Xu
2008-12-24 13:42   ` Dhaval Giani
2008-12-24 20:37     ` Herbert Xu
2008-12-24 21:32       ` Peter Zijlstra
2008-12-24 22:07         ` Herbert Xu
2008-12-25  7:52           ` Peter Zijlstra [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=1230191527.9487.262.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=balbir@in.ibm.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=dhaval@linux.vnet.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=vatsa@linux.vnet.ibm.com \
    /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