From: "Mauricio Lin" <mauriciolin@gmail.com>
To: balbir@in.ibm.com
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Jiffies wraparound is not treated in the schedstats
Date: Wed, 8 Nov 2006 14:05:10 -0400 [thread overview]
Message-ID: <3f250c710611081005v5fcf3236qfb10b47bab1ada5f@mail.gmail.com> (raw)
Hi Balbir,
Do you know why in the sched_info_arrive() and sched_info_depart()
functions the calculation of delta_jiffies does not use the time_after
or time_before macro to prevent the miscalculation when jiffies
overflow?
For instance the delta_jiffies variable is simply calculated as:
delta_jiffies = now - t->sched_info.last_queued;
Do not you think the more logical way should be
if (time_after(now, t->sched_info.last_queued))
delta_jiffies = now - t->sched_info.last_queued;
else
delta_jiffies = (MAX_JIFFIES - t->sched_info.last_queued) + now
I have included more variables to measure some issues of schedule in
the kernel (following schedstat idea) and I noticed that jiffies
wraparound has led to wrong values, since the user space tool when
collecting the values is producing negative values.
Any comments?
Can I provide a patch for that?
BR,
Mauricio Lin.
next reply other threads:[~2006-11-08 18:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-08 18:05 Mauricio Lin [this message]
2006-11-09 6:29 ` Balbir Singh
2006-11-09 6:45 ` Balbir Singh
2006-11-09 14:35 ` Mauricio Lin
2007-05-30 4:03 ` Oleg Verych
2006-11-08 19:01 Kaz Kylheku
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=3f250c710611081005v5fcf3236qfb10b47bab1ada5f@mail.gmail.com \
--to=mauriciolin@gmail.com \
--cc=balbir@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®