All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Primiano Tucci <p.tucci@gmail.com>
Cc: rostedt@goodmis.org, linux-kernel@vger.kernel.org,
	tglx <tglx@linutronix.de>
Subject: Re: Considerations on sched APIs under RT patch
Date: Wed, 21 Apr 2010 22:58:16 +0200	[thread overview]
Message-ID: <1271883496.1776.263.camel@laptop> (raw)
In-Reply-To: <s2tc5b2c05b1004211338y814bc3b2o547a6eecdf64ca7f@mail.gmail.com>

On Wed, 2010-04-21 at 22:38 +0200, Primiano Tucci wrote:
> > No, any syscall can end up blocking/scheduling there are no exceptions.
> > But blocking doesn't mean its non-deterministic, esp. when coupled with
> > things like PI.
> >
> > But you do have to treat system resources as such, that is they can (and
> > will) create cross-cpu dependencies, if you do not take that into
> > account you will of course be surprised.
> >
> I actually don't understand why do you recall PI so frequently, it
> seems to be the unique point of interest.

PI keeps preemptible locks working in a RT environment. Non-preemptible
or preemptible+PI are both valid RT constructs that can be analyzed 

> Actually I take care about not sharing cross-cpu resources, but I
> cannot take care of what the kernel should do.

An SMP kernel must be treated as a cross-cpu resource. There's just no
way around that. For instance, Unix allows two processes on different
cpus to invoke sched_setscheduler/sched_setaffinity or any number of
system calls on the same target process. Filesystems are shared etc..

> In my viewpoint is unacceptable that the scheduler apis can led into a
> rescheduling.

They can even lead to pagefaults and disk IO if you're not careful.

I'm not sure if there are blocking locks left thereabout, but spinlocks
or rt_mutex, both create cross-cpu dependencies that need to be
analyzed, !preempt isn't magic in any way.

> It voids any form of process control.
> If I lose the control while controlling other processes, Quis
> custodiet ipsos custodes?
> 
> P.S. It actually does not happen in other RTOSes, e.g., VxWorks SMP

I don't know any of those, but its impossible to migrate tasks from one
cpu to another without creating cross-cpu dependencies.

Whether locks are preemptible or not doesn't make them any less
analyzable, if you use system-calls in your RT program, their
implementation needs to be considered.




  reply	other threads:[~2010-04-21 20:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 20:48 Considerations on sched APIs under RT patch Primiano Tucci
2010-04-20  9:20 ` Peter Zijlstra
2010-04-20 21:56   ` Primiano Tucci
2010-04-20 23:00     ` Steven Rostedt
2010-04-21  5:16       ` Primiano Tucci
2010-04-21  8:49         ` Peter Zijlstra
2010-04-21 12:46           ` Steven Rostedt
2010-04-21 19:24             ` Primiano Tucci
2010-04-21 19:57               ` Peter Zijlstra
2010-04-21 20:38                 ` Primiano Tucci
2010-04-21 20:58                   ` Peter Zijlstra [this message]
2010-04-22 13:20                     ` Steven Rostedt
2010-04-22 13:50                       ` Primiano Tucci
2010-04-22 13:57                         ` Peter Zijlstra
2010-04-22 15:40                           ` Primiano Tucci
2010-04-22 16:28                             ` Peter Zijlstra
2010-04-22 17:48                               ` Bjoern Brandenburg
2010-04-22 19:33                               ` Primiano Tucci
2010-04-21 12:56     ` Peter Zijlstra
2010-04-27 13:18     ` Thomas Gleixner

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=1271883496.1776.263.camel@laptop \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.tucci@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.