LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "J.C. Pizarro" <jcpiza@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>,
	"Linus Torvalds" <torvalds@linux-foundation.org>
Subject: Please, put 64-bit counter per task and incr.by.one each ctxt switch.
Date: Sun, 24 Feb 2008 04:08:38 +0100	[thread overview]
Message-ID: <998d0e4a0802231908h37978d07wa5379d5c01b2c2ee@mail.gmail.com> (raw)

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:)

             reply	other threads:[~2008-02-24  3:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-24  3:08 J.C. Pizarro [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=998d0e4a0802231908h37978d07wa5379d5c01b2c2ee@mail.gmail.com \
    --to=jcpiza@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: Please, put 64-bit counter per task and incr.by.one each ctxt switch.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).