1. 31 3月, 2011 1 次提交
    • D
      sched: Leave sched_setscheduler() earlier if possible, do not disturb SCHED_FIFO tasks · a51e9198
      Dario Faggioli 提交于
      sched_setscheduler() (in sched.c) is called in order of changing the
      scheduling policy and/or the real-time priority of a task. Thus,
      if we find out that neither of those are actually being modified, it
      is possible to return earlier and save the overhead of a full
      deactivate+activate cycle of the task in question.
      
      Beside that, if we have more than one SCHED_FIFO task with the same
      priority on the same rq (which means they share the same priority queue)
      having one of them changing its position in the priority queue because of
      a sched_setscheduler (as it happens by means of the deactivate+activate)
      that does not actually change the priority violates POSIX which states,
      for SCHED_FIFO:
      
        "If a thread whose policy or priority has been modified by
         pthread_setschedprio() is a running thread or is runnable, the effect on
         its position in the thread list depends on the direction of the
         modification, as follows: a. <...> b. If the priority is unchanged, the
         thread does not change position in the thread list. c. <...>"
      
           http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_08.html
      
       (ed: And the POSIX specification here does, briefly and somewhat unexpectedly,
            match what common sense tells us as well. )
      Signed-off-by: NDario Faggioli <raistlin@linux.it>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <1300971618.3960.82.camel@Palantir>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a51e9198
  2. 30 3月, 2011 3 次提交
  3. 29 3月, 2011 8 次提交
  4. 28 3月, 2011 3 次提交
  5. 27 3月, 2011 5 次提交
  6. 26 3月, 2011 3 次提交
  7. 25 3月, 2011 1 次提交
  8. 24 3月, 2011 16 次提交