lkml.org 
[lkml]   [2012]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH 20/24] nohz: Full dynticks mode
Date
On Wed, 26 Dec 2012 15:12:22 +0900, Namhyung Kim wrote:
> Hi Frederic,
>
> On Thu, 20 Dec 2012 19:33:07 +0100, Frederic Weisbecker wrote:
>> When a CPU is in full dynticks mode, try to switch
>> it to nohz mode from the interrupt exit path if it is
>> running a single non-idle task.
>>
>> Then restart the tick if necessary if we are enqueuing a
>> second task while the timer is stopped, so that the scheduler
>> tick is rearmed.
>>
>> [TODO: Check remaining things to be done from scheduler_tick()]
>>
>> [ Included build fix from Geoff Levand ]
> [snip]
>> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
>> index db3d4df..f3d8f4a 100644
>> --- a/kernel/sched/sched.h
>> +++ b/kernel/sched/sched.h
>> @@ -943,6 +943,14 @@ static inline u64 steal_ticks(u64 steal)
>> static inline void inc_nr_running(struct rq *rq)
>> {
>> rq->nr_running++;
>> +
>> + if (rq->nr_running == 2) {
>> + if (tick_nohz_full_cpu(rq->cpu)) {
>> + /* Order rq->nr_running write against the IPI */
>> + smp_wmb();
>> + smp_send_reschedule(rq->cpu);
>> + }
>> + }
>
> This block should be guarded with #ifdef CONFIG_SMP, otherwise:

Or apply something like this:


diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 0cd913ed29de..8de13ca88a17 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -957,10 +957,10 @@ static inline void inc_nr_running(struct rq *rq)
rq->nr_running++;

if (rq->nr_running == 2) {
- if (tick_nohz_full_cpu(rq->cpu)) {
+ if (tick_nohz_full_cpu(cpu_of(rq))) {
/* Order rq->nr_running write against the IPI */
smp_wmb();
- smp_send_reschedule(rq->cpu);
+ smp_send_reschedule(cpu_of(rq));
}
}
}

Thanks,
Namhyung


\
 
 \ /
  Last update: 2012-12-26 08:41    [W:0.550 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site