public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Peschke <mp3@de.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Patch 5/6] statistics infrastructure
Date: Tue, 30 May 2006 19:17:19 +0200	[thread overview]
Message-ID: <447C7E1F.7020602@de.ibm.com> (raw)
In-Reply-To: <20060524155735.04ed777a.akpm@osdl.org>

Andrew Morton wrote:
> Martin Peschke <mp3@de.ibm.com> wrote:
>> +static int statistic_alloc(struct statistic *stat,
>> +			   struct statistic_info *info)
>> +{
>> +	int cpu;
>> +	stat->age = sched_clock();
> 
> argh.  Didn't we end up finding a way to avoid this?
> 
> At the least, we should have statistics_clock(), or nsec_clock(), or
> something which is decoupled from this low-level scheduler-internal thing,
> and which architectures can implement (vis attribute-weak) if they have a
> preferred/better/more-accurate alternative.

I use clocks for two purposes. Both have used sched_clock() so far.

The statistics infrastructure itself uses a clock only for time stamps
that tell users what time a statistic has been switched on/off and reset.
This is what you have spotted here.

(The other and more important requirement regards exploiters of the
statistics infrastructure. They need a clock to measure latencies,
which they can report then.)

Regarding those time stamps, I think it best to make them look like other
timestamps, specifically the printk() time stamps in order not to confuse
users. That is why, one of my patches introduces nsec_to_timestamp()
based on some lines from printk(). Printk() uses printk_clock() as
source, which is nothing else than a sched_clock() call, unless
reimpelmented by architectures (only done for ia64).
If I want similar timestamps, I need the same time source too.

Now my question:

Would I get away with making printk_clock() a timestamp_clock() that
should be used by anyone exporting nsec_to_timestamp()-formated time
stamps to user space, including me?

I would then continue to see the use of sched_clock() in printk_clock()
... aehm timestamp_clock() as somebody else's problem (or at least
as a subordinate problem).
Thoughts?  <ducking down>

Martin


  parent reply	other threads:[~2006-05-30 17:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24 12:33 [Patch 5/6] statistics infrastructure Martin Peschke
2006-05-24 22:57 ` Andrew Morton
2006-05-29 22:17   ` Martin Peschke
2006-05-30  1:17     ` Andrew Morton
2006-05-29 22:17   ` [Patch] statistics infrastructure - update 1 Martin Peschke
2006-05-30  8:07     ` Heiko Carstens
2006-05-30 11:22       ` Martin Peschke
2006-05-30 17:17   ` Martin Peschke [this message]
2006-05-30 19:19     ` [Patch 5/6] statistics infrastructure Andrew Morton
2006-05-25  8:05 ` Nikita Danilov
2006-05-30 11:35   ` Martin Peschke
  -- strict thread matches above, loose matches on Subject: below --
2006-05-19 16:13 Martin Peschke
2005-12-16 12:27 [patch " Martin Peschke
2005-12-14 16:46 Martin Peschke
2005-12-14 18:38 ` Andi Kleen
2005-12-16  1:00   ` Martin Peschke

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=447C7E1F.7020602@de.ibm.com \
    --to=mp3@de.ibm.com \
    --cc=akpm@osdl.org \
    --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