<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/sched/rt.c, branch v3.4.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/sched/rt.c?h=v3.4.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/sched/rt.c?h=v3.4.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-03-27T12:52:12Z</updated>
<entry>
<title>sched/rt: Improve pick_next_highest_task_rt()</title>
<updated>2012-03-27T12:52:12Z</updated>
<author>
<name>Michael J Wang</name>
<email>mjwang@broadcom.com</email>
</author>
<published>2012-03-19T22:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1b028abc779b67b699daff55e27d2432f8d92666'/>
<id>urn:sha1:1b028abc779b67b699daff55e27d2432f8d92666</id>
<content type='text'>
Avoid extra work by continuing on to the next rt_rq if the highest
prio task in current rt_rq is the same priority as our candidate
task.

More detailed explanation:  if next is not NULL, then we have found a
candidate task, and its priority is next-&gt;prio.  Now we are looking
for an even higher priority task in the other rt_rq's.  idx is the
highest priority in the current candidate rt_rq.  In the current 3.3
code, if idx is equal to next-&gt;prio, we would start scanning the tasks
in that rt_rq and replace the current candidate task with a task from
that rt_rq.  But the new task would only have a priority that is equal
to our previous candidate task, so we have not advanced our goal of
finding a higher prio task.  So we should avoid the extra work by
continuing on to the next rt_rq if idx is equal to next-&gt;prio.

Signed-off-by: Michael J Wang &lt;mjwang@broadcom.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Reviewed-by: Yong Zhang &lt;yong.zhang0@gmail.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/2EF88150C0EF2C43A218742ED384C1BC0FC83D6B@IRVEXCHMB08.corp.ad.broadcom.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>printk/sched: Introduce special printk_sched() for those awkward moments</title>
<updated>2012-03-12T19:43:16Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2012-02-27T09:47:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3ccf3e8306156a28213adc720aba807e9a901ad5'/>
<id>urn:sha1:3ccf3e8306156a28213adc720aba807e9a901ad5</id>
<content type='text'>
There's a few awkward printk()s inside of scheduler guts that people
prefer to keep but really are rather deadlock prone. Fudge around it
by storing the text in a per-cpu buffer and poll it using the existing
printk_tick() handler.

This will drop output when its more frequent than once a tick, however
only the affinity thing could possible go that fast and for that just
one should suffice to notify the admin he's done something silly..

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/n/tip-wua3lmkt3dg8nfts66o6brne@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>sched/rt: Do not throttle when PI boosting</title>
<updated>2012-03-01T09:28:02Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2011-10-18T20:03:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7abc63b1bd412f7655b62ef3e35c3c11c5134636'/>
<id>urn:sha1:7abc63b1bd412f7655b62ef3e35c3c11c5134636</id>
<content type='text'>
When a runqueue has rt_runtime_us = 0 then the only way it can
accumulate rt_time is via PI boosting. That causes the runqueue
to be throttled and replenishing does not change anything due to
rt_runtime_us = 0. So avoid that situation by clearing rt_time and
skip the throttling alltogether.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
[ Changelog ]
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/n/tip-7x70cypsotjb4jvcor3edctk@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>sched/rt: Keep period timer ticking when rt throttling is active</title>
<updated>2012-03-01T09:28:01Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2011-10-18T20:03:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=42c62a589f1ccbf38a02cb732231f9c2fccc5ab0'/>
<id>urn:sha1:42c62a589f1ccbf38a02cb732231f9c2fccc5ab0</id>
<content type='text'>
When a runqueue is throttled we cannot disable the period timer
because that timer is the only way to undo the throttling.

We got stale throttling entries when a rq was throttled and then the
global sysctl was disabled, which stopped the timer.

Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
[ Added changelog ]
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/n/tip-nuj34q52p6ro7szapuz84i0v@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>sched: Make initial SCHED_RR timeslace DEF_TIMESLICE</title>
<updated>2012-02-22T11:28:29Z</updated>
<author>
<name>Hiroshi Shimamoto</name>
<email>h-shimamoto@ct.jp.nec.com</email>
</author>
<published>2012-02-16T05:52:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=de5bdff7a72acc281219be2b8edeeca1fd81c542'/>
<id>urn:sha1:de5bdff7a72acc281219be2b8edeeca1fd81c542</id>
<content type='text'>
Current the initial SCHED_RR timeslice of init_task is HZ, which means
1s, and is not same as the default SCHED_RR timeslice DEF_TIMESLICE.

Change that initial timeslice to the DEF_TIMESLICE.

Signed-off-by: Hiroshi Shimamoto &lt;h-shimamoto@ct.jp.nec.com&gt;
[ s/DEF_TIMESLICE/RR_TIMESLICE/g ]
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/4F3C9995.3010800@ct.jp.nec.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>sched/rt: Fix task stack corruption under __ARCH_WANT_INTERRUPTS_ON_CTXSW</title>
<updated>2012-01-27T11:49:41Z</updated>
<author>
<name>Chanho Min</name>
<email>chanho0207@gmail.com</email>
</author>
<published>2012-01-05T11:00:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cb297a3e433dbdcf7ad81e0564e7b804c941ff0d'/>
<id>urn:sha1:cb297a3e433dbdcf7ad81e0564e7b804c941ff0d</id>
<content type='text'>
This issue happens under the following conditions:

 1. preemption is off
 2. __ARCH_WANT_INTERRUPTS_ON_CTXSW is defined
 3. RT scheduling class
 4. SMP system

Sequence is as follows:

 1.suppose current task is A. start schedule()
 2.task A is enqueued pushable task at the entry of schedule()
   __schedule
    prev = rq-&gt;curr;
    ...
    put_prev_task
     put_prev_task_rt
      enqueue_pushable_task
 4.pick the task B as next task.
   next = pick_next_task(rq);
 3.rq-&gt;curr set to task B and context_switch is started.
   rq-&gt;curr = next;
 4.At the entry of context_swtich, release this cpu's rq-&gt;lock.
   context_switch
    prepare_task_switch
     prepare_lock_switch
      raw_spin_unlock_irq(&amp;rq-&gt;lock);
 5.Shortly after rq-&gt;lock is released, interrupt is occurred and start IRQ context
 6.try_to_wake_up() which called by ISR acquires rq-&gt;lock
    try_to_wake_up
     ttwu_remote
      rq = __task_rq_lock(p)
      ttwu_do_wakeup(rq, p, wake_flags);
        task_woken_rt
 7.push_rt_task picks the task A which is enqueued before.
   task_woken_rt
    push_rt_tasks(rq)
     next_task = pick_next_pushable_task(rq)
 8.At find_lock_lowest_rq(), If double_lock_balance() returns 0,
   lowest_rq can be the remote rq.
  (But,If preemption is on, double_lock_balance always return 1 and it
   does't happen.)
   push_rt_task
    find_lock_lowest_rq
     if (double_lock_balance(rq, lowest_rq))..
 9.find_lock_lowest_rq return the available rq. task A is migrated to
   the remote cpu/rq.
   push_rt_task
    ...
    deactivate_task(rq, next_task, 0);
    set_task_cpu(next_task, lowest_rq-&gt;cpu);
    activate_task(lowest_rq, next_task, 0);
 10. But, task A is on irq context at this cpu.
     So, task A is scheduled by two cpus at the same time until restore from IRQ.
     Task A's stack is corrupted.

To fix it, don't migrate an RT task if it's still running.

Signed-off-by: Chanho Min &lt;chanho.min@lge.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: &lt;stable@kernel.org&gt;
Link: http://lkml.kernel.org/r/CAOAMb1BHA=5fm7KTewYyke6u-8DP0iUuJMpgQw54vNeXFsGpoQ@mail.gmail.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>sched/rt: Code cleanup, remove a redundant function call</title>
<updated>2011-12-06T08:06:28Z</updated>
<author>
<name>Shan Hai</name>
<email>haishan.bai@gmail.com</email>
</author>
<published>2011-11-29T03:03:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5b680fd61388abb9059fbc8e7a2f60f602bfce15'/>
<id>urn:sha1:5b680fd61388abb9059fbc8e7a2f60f602bfce15</id>
<content type='text'>
The second call to sched_rt_period() is redundant, because the value of the
rt_runtime was already read and it was protected by the -&gt;rt_runtime_lock.

Signed-off-by: Shan Hai &lt;haishan.bai@gmail.com&gt;
Reviewed-by: Kamalesh Babulal &lt;kamalesh@linux.vnet.ibm.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1322535836-13590-2-git-send-email-haishan.bai@gmail.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>sched: Use rt.nr_cpus_allowed to recover select_task_rq() cycles</title>
<updated>2011-12-06T07:51:26Z</updated>
<author>
<name>Mike Galbraith</name>
<email>mgalbraith@suse.de</email>
</author>
<published>2011-11-22T14:18:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=76854c7e8f3f4172fef091e78d88b3b751463ac6'/>
<id>urn:sha1:76854c7e8f3f4172fef091e78d88b3b751463ac6</id>
<content type='text'>
rt.nr_cpus_allowed is always available, use it to bail from select_task_rq()
when only one cpu can be used, and saves some cycles for pinned tasks.

See the line marked with '*' below:

  # taskset -c 3 pipe-test

   PerfTop:     997 irqs/sec  kernel:89.5%  exact:  0.0% [1000Hz cycles],  (all, CPU: 3)
------------------------------------------------------------------------------------------------

             Virgin                                    Patched
             samples  pcnt function                    samples  pcnt function
             _______ _____ ___________________________ _______ _____ ___________________________

             2880.00 10.2% __schedule                  3136.00 11.3% __schedule
             1634.00  5.8% pipe_read                   1615.00  5.8% pipe_read
             1458.00  5.2% system_call                 1534.00  5.5% system_call
             1382.00  4.9% _raw_spin_lock_irqsave      1412.00  5.1% _raw_spin_lock_irqsave
             1202.00  4.3% pipe_write                  1255.00  4.5% copy_user_generic_string
             1164.00  4.1% copy_user_generic_string    1241.00  4.5% __switch_to
             1097.00  3.9% __switch_to                  929.00  3.3% mutex_lock
              872.00  3.1% mutex_lock                   846.00  3.0% mutex_unlock
              687.00  2.4% mutex_unlock                 804.00  2.9% pipe_write
              682.00  2.4% native_sched_clock           713.00  2.6% native_sched_clock
              643.00  2.3% system_call_after_swapgs     653.00  2.3% _raw_spin_unlock_irqrestore
              617.00  2.2% sched_clock_local            633.00  2.3% fsnotify
              612.00  2.2% fsnotify                     605.00  2.2% sched_clock_local
              596.00  2.1% _raw_spin_unlock_irqrestore  593.00  2.1% system_call_after_swapgs
              542.00  1.9% sysret_check                 559.00  2.0% sysret_check
              467.00  1.7% fget_light                   472.00  1.7% fget_light
              462.00  1.6% finish_task_switch           461.00  1.7% finish_task_switch
              437.00  1.5% vfs_write                    442.00  1.6% vfs_write
              431.00  1.5% do_sync_write                428.00  1.5% do_sync_write
*             413.00  1.5% select_task_rq_fair          404.00  1.5% _raw_spin_lock_irq
              386.00  1.4% update_curr                  402.00  1.4% update_curr
              385.00  1.4% rw_verify_area               389.00  1.4% do_sync_read
              377.00  1.3% _raw_spin_lock_irq           378.00  1.4% vfs_read
              369.00  1.3% do_sync_read                 340.00  1.2% pipe_iov_copy_from_user
              360.00  1.3% vfs_read                     316.00  1.1% __wake_up_sync_key
              342.00  1.2% hrtick_start_fair            313.00  1.1% __wake_up_common

Signed-off-by: Mike Galbraith &lt;efault@gmx.de&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1321971504.6855.15.camel@marge.simson.net
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>sched: Move all scheduler bits into kernel/sched/</title>
<updated>2011-11-17T11:20:22Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2011-11-15T16:14:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=391e43da797a96aeb65410281891f6d0b0e9611c'/>
<id>urn:sha1:391e43da797a96aeb65410281891f6d0b0e9611c</id>
<content type='text'>
There's too many sched*.[ch] files in kernel/, give them their own
directory.

(No code changed, other than Makefile glue added.)

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
