BFS prerequisites and tidy up of resched functions
[kernel-bfs] / kernel-bfs-2.6.28 / debian / patches / bfs / tick_sched-set_inidle_unconditionally.patch
1 --- linux-2.6.28/kernel/time/tick-sched.c       2011-06-20 00:00:22.673390790 +0200
2 +++ linux-2.6.28.new/kernel/time/tick-sched.c   2011-06-20 12:12:30.374080397 +0200
3 @@ -231,6 +231,13 @@ void tick_nohz_stop_sched_tick(int inidl
4         if (!inidle && !ts->inidle)
5                 goto end;
6  
7 +       /*
8 +        * Set ts->inidle unconditionally. Even if the system did not
9 +        * switch to NOHZ mode the cpu frequency governers rely on the
10 +        * update of the idle time accounting in tick_nohz_start_idle().
11 +        */
12 +       ts->inidle = 1;
13 +
14         now = tick_nohz_start_idle(ts);
15  
16         /*
17 @@ -248,12 +255,10 @@ void tick_nohz_stop_sched_tick(int inidl
18         if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
19                 goto end;
20  
21 -       ts->inidle = 1;
22 -
23         if (need_resched())
24                 goto end;
25  
26 -       if (unlikely(local_softirq_pending())) {
27 +       if (unlikely(local_softirq_pending() && cpu_online(cpu))) {
28                 static int ratelimit;
29  
30                 if (ratelimit < 10) {