lkml.org 
[lkml]   [2008]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Please, put 64-bit counter per task and incr.by.one each ctxt switch.
On Sun, 24 Feb 2008 05:08:46 +0100
"J.C. Pizarro" <jcpiza@gmail.com> wrote:

OK, one last reply on the (overly optimistic?) assumption that you are not a troll.

> +++ linux-2.6_git-20080224/include/linux/sched.h 2008-02-24
> 04:50:18.000000000 +0100
> @@ -1007,6 +1007,12 @@
> struct hlist_head preempt_notifiers;
> #endif
>
> + unsigned long long ctxt_switch_counts; /* 64-bit switches' count */
> + /* ToDo:
> + * To implement a poller/clock for CPU-scheduler that only reads
> + * these counts of context switches of the runqueue's tasks.
> + * No problem if this poller/clock is not implemented. */

So you're introducing a statistic, but have not yet written any code
that uses it?

> + p->ctxt_switch_counts = 0ULL; /* task's 64-bit counter inited 0 */

Because we can all read C, there is no need to tell people in comments
what the code does. Comments are there to explain why the code does
things, if an explanation is needed.

> > > I will explain your later why of it.
> >
> >
> > ... and explain exactly why the kernel needs this extra code.
>
> One reason: for the objective of gain interactivity, it's an issue that
> CFS fair scheduler lacks it.

Your patch does not actually help interactivity, because all it does
is add an irq spinlock in a hot path (bad idea) and a counter which
nothing reads.

--
All rights reversed.


\
 
 \ /
  Last update: 2008-02-24 05:29    [W:0.092 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site