lkml.org 
[lkml]   [2016]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Subjectsched: current instead rq->current
From
Date
Hello,

At the beginning of __schedule (kernel/sched/core.c), the current task
is get with rq->curr. I try to to understand why not directly using
current instead?

Since a runqueue is specific to a CPU, it dosen't make sense to get the
the current task of another CPU's runqueue. Yes?

I try the following of Linus's master branch

-       int cpu;
 
-       cpu = smp_processor_id();
-       rq = cpu_rq(cpu);
-       prev = rq->curr;
+       rq = cpu_rq(smp_processor_id());
+       prev = current;

and it seems to work (only tested on x86-64), but... To simple?

Thanks!

Colin

\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.084 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site