public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <piggin@cyberone.com.au>
To: Loic Domaigne <loic-dev@gmx.net>
Cc: nptl@bullopensource.org, Linux-Kernel@Vger.Kernel.ORG, mingo@elte.hu
Subject: Re: OSDL Bug 3770
Date: Tue, 21 Dec 2004 22:09:50 +1100	[thread overview]
Message-ID: <41C8047E.1030403@cyberone.com.au> (raw)
In-Reply-To: <9785.1103562168@www38.gmx.net>



Loic Domaigne wrote:

>Hello Nick,
>
>Thanks for your reply! 
> 
>L = Loic 
>N = Nick 
>
>N> lkml: We're discussing the fact that on SMP machines, our realtime 
>N> scheduling policies are per-CPU only. This caused a problem where a 
>N> high priority task on one CPU caused all lower priority tasks on that 
>N> CPU to be starved, while tasks on another CPU with the same low 
>N> priority were able to run.
>
>That summary should readily motivate you to make a patch ;-) 
>
>But thing are a bit worse actually. It is easily to build an example 
>where a lower priority thread is executing while a higer priority thread
>is waiting. For instance, something like: 
>
>CPU0:
>Thread with prio 30 gets the CPU.
>Thread with prio 25 is waiting.
>
>CPU1:
>Thread with prio 20 gets the CPU.
>Thread with prio 15 is waiting.
>
>

Yep.


[snip]

>L> The reason is extremely simple: the application *CANNOT* necessarily 
>L> known that it gets stuck behind a higher-priority thread (though it 
>L> could had run on another CPU if the scheduler had decided otherwise). 
>L> That's *NOT* doable to program in a deterministic fashion in such 
>L> "realtime"-environement
>N>
>N>
>N> You could use CPU binding. I'd argue that this may be nearly a
>N> requirement for any realtime system of significant complexity on 
>N> an SMP system.
>
>Agree. Real-world system will likely want to have a control on which 
>CPU the threads runs on SMP machine. 
>
>Does Linux tolerate hard CPU binding? By hard CPU binding, I mean 
>that the application tells the scheduler "I want to run there", 
>and the scheduler schedules the thread(s) "there" regardless if it 
>makes sense or not ( The decision is left to the application). 
>
>With such hard CPU binding, it seems to me that our "unfortunate 
>behavior" isn't problematic anymore. Because the application can gain 
>control again over the scheduler (so to speak). 
>
>On the other hand, if the scheduler might ignore the CPU binding 
>(thus, not hard binding, but rather CPU affinity), then I am afraid 
>that the issue might remain problematic.  
>
>

Yes, it does support hard CPU binding - sched_setaffinity

[snip interesting dialogue]

Thanks for your detailed comments, they were interesting.

I hope that the fact we have hard CPU binding is a sufficient
solution to the problem.

Thanks
Nick


  parent reply	other threads:[~2004-12-21 11:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-20 17:02 Re: OSDL Bug 3770 Loic Domaigne
2004-12-21 10:09 ` Ingo Molnar
2004-12-21 10:20   ` Loic Domaigne
2004-12-21 10:22   ` [nptl] " Sebastien Decugis
2004-12-24 15:00     ` Sebastien Decugis
2004-12-21 11:09 ` Nick Piggin [this message]
2004-12-21 12:06   ` Loic Domaigne
2004-12-21 13:32     ` Ingo Molnar
     [not found] <1102071900.14792.81.camel@decugiss.frec.bull.fr>
     [not found] ` <41B6368F.9060704@cyberone.com.au>
     [not found]   ` <1102495648.3613.39.camel@decugiss.frec.bull.fr>
     [not found]     ` <41B6C2D4.5040705@cyberone.com.au>
     [not found]       ` <1102497754.3644.1.camel@decugiss.frec.bull.fr>
     [not found]         ` <41B6D544.1010106@cyberone.com.au>
     [not found]           ` <1102501896.3644.5.camel@decugiss.frec.bull.fr>
     [not found]             ` <41B6D824.80804@cyberone.com.au>
     [not found]               ` <41B6DA44.4020100@cyberone.com.au>
     [not found]                 ` <1102502987.3644.7.camel@decugiss.frec.bull.fr>
     [not found]                   ` <41B6DEC1.9050506@cyberone.com.au>
     [not found]                     ` <1102523077.3644.42.camel@decugiss.frec.bull.fr>
     [not found]                       ` <41B8115C.30509@cyberone.com.au>
     [not found]                         ` <41B82435.7020802@cyberone.com.au>
     [not found]                           ` <1102590314.3644.107.camel@decugiss.frec.bull.fr>
     [not found]                             ` <41C3F4BB.2050102@gmx.net>
2004-12-18  9:43                               ` Nick Piggin

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=41C8047E.1030403@cyberone.com.au \
    --to=piggin@cyberone.com.au \
    --cc=Linux-Kernel@Vger.Kernel.ORG \
    --cc=loic-dev@gmx.net \
    --cc=mingo@elte.hu \
    --cc=nptl@bullopensource.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