LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Please, put 64-bit counter per task and incr.by.one each ctxt switch.
@ 2008-02-24  3:08 J.C. Pizarro
  2008-02-24  3:17 ` Rik van Riel
  0 siblings, 1 reply; 10+ messages in thread
From: J.C. Pizarro @ 2008-02-24  3:08 UTC (permalink / raw)
  To: LKML, Linus Torvalds

Hello,

We will need 64 bit counters of the slow context switches,
  one counter for each new created task (e.g. u64 ctxt_switch_counts;)

We will only need them during the lifetime of the tasks.

To increment by +1 the task's 64 bit counter (it's fast)
  each one slow context switch.

*kernel/sched.c:
void context_switch(...) { ... } # incr. +1 here.
void wake_up_new_task(...) { ... } # ->ctxt_switch_counts = 0ULL;

*include/linux/sched.h:
struct task_struct { ... } # add 64-bit (u64 ctxt_switch_counts;) here.

Please, do it and we can do it better than CFS fair scheduler.

I will explain your later why of it.

   O:)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-02-26 13:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-24  3:08 Please, put 64-bit counter per task and incr.by.one each ctxt switch J.C. Pizarro
2008-02-24  3:17 ` Rik van Riel
2008-02-24  4:08   ` J.C. Pizarro
2008-02-24  4:26     ` Rik van Riel
2008-02-24 13:12       ` J.C. Pizarro
2008-02-24 17:53         ` Mike Galbraith
2008-02-25 20:34         ` Andrew Morton
2008-02-26 13:20           ` J.C. Pizarro
2008-02-26 13:41             ` Alexey Dobriyan
2008-02-24  5:08     ` Mike Galbraith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).