From: Karim Yaghmour <karim@opersys.com>
To: george anzinger <george@mvista.com>
Cc: mbs <mbs@mc.com>,
dank@kegel.com,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Periodic clock tick considered harmful (was: Re: HZ, preferably as small as possible)
Date: Thu, 11 Jul 2002 18:32:57 -0400 [thread overview]
Message-ID: <3D2E0799.612340BF@opersys.com> (raw)
In-Reply-To: 3D2DE9B2.70A21F7E@mvista.com
george anzinger wrote:
> First blush is HELL YES! The issue is accounting. When you
> ask how long a program ran, you are looking at the
> accounting that happens on a tick. This is where one of two
> counters gets bumped (one for system, the other for user,
> depending on what was interrupted). This information could,
> of course, be gathered every system call/ exit and every
> context switch, BUT, there are FAR more system calls and
> context switches than 1/HZ ticks. Thus collecting
> accounting info this way adds overhead as the system load
> increases, a VERY BAD thing IMHO.
In addition to syscall entries/exits and sched changes, you then
also need to keep track of interrupt and trap entries/exits in
order to have the complete picture. Even then, determining exactly
when you're going to return to user-space can be tricky. Your
statement is indeed accurate, exact accounting's cost increases
linearly with the number of events that occur.
Having exact accounting all the time is certainly not necessary,
but it is indeed sometimes useful. *shameless self-promotion*,
That's yet another reason why I think LTT's inclusion in the
mailing kernel would be helpful. In addition to the rest of
the capabilities it provides, it provides exact accounting for
whoever really needs it on the spot.
If you are looking for better accounting using clock ticks, then
have a look at McCanne and Torek's paper "A Randomized Sampling
Clock for CPU Utilization Estimation and Code Profiling"
presented at Usenix in '93. As the title implies, they vary
the clock to obtain random samples and therefore obtain very
accurate results about system accounting. The use of hardware
counters to obtain samples is also viable, although it's much
more arch dependent than random clock ticks.
Cheers,
Karim
===================================================
Karim Yaghmour
karim@opersys.com
Embedded and Real-Time Linux Expert
===================================================
next prev parent reply other threads:[~2002-07-11 22:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-11 16:44 Periodic clock tick considered harmful (was: Re: HZ, preferably as small as possible) dank
2002-07-11 16:59 ` Thunder from the hill
2002-07-11 19:45 ` Arnd Bergmann
2002-07-11 17:05 ` Hubertus Franke
2002-07-11 19:06 ` george anzinger
2002-07-11 19:19 ` mbs
2002-07-11 20:25 ` george anzinger
2002-07-11 21:29 ` Periodic clock tick considered harmful (was: Re: HZ, preferably as Alan Cox
2002-07-11 21:43 ` george anzinger
2002-07-11 22:32 ` Karim Yaghmour [this message]
2002-07-15 5:21 ` Periodic clock tick considered harmful (was: Re: HZ, preferably as small as possible) Linus Torvalds
2002-07-15 5:43 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2002-07-11 21:28 Per Jessen
2002-07-16 9:10 Martin Schwidefsky
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=3D2E0799.612340BF@opersys.com \
--to=karim@opersys.com \
--cc=dank@kegel.com \
--cc=george@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbs@mc.com \
/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