public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Martin Peschke <mp3@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [Patch 3/6] statistics infrastructure - prerequisite: timestamp
Date: Wed, 24 May 2006 15:08:30 -0700	[thread overview]
Message-ID: <20060524150830.3864ae90.akpm@osdl.org> (raw)
In-Reply-To: <1148473908.2934.14.camel@dyn-9-152-230-71.boeblingen.de.ibm.com>

Martin Peschke <mp3@de.ibm.com> wrote:
>
> +static inline int nsec_to_timestamp(char *s, unsigned long long t)
> +{
> +	unsigned long nsec_rem = do_div(t, NSEC_PER_SEC);
> +	return sprintf(s, "[%5lu.%06lu]", (unsigned long)t,
> +		       nsec_rem/NSEC_PER_USEC);
> +}

do_div() is actually defined in terms of u64, not unsigned long long. 
Although afaict this will all work OK and all the usual type promotions
will dtrt.

Which begs the question: how _does_ the kernel represent nanoseconds?  The
time-management code is a bit undecided (search for long long in
posix-cpu-timers.c, and for u64 in hrtimers.c).  All a bit confused.

Anwyay.  This function is too big and slow to be inlined..

  reply	other threads:[~2006-05-24 22:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24 12:31 [Patch 3/6] statistics infrastructure - prerequisite: timestamp Martin Peschke
2006-05-24 22:08 ` Andrew Morton [this message]
2006-05-24 22:45   ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2006-05-19 16:11 Martin Peschke
2006-05-23 13:06 ` Balbir Singh
2006-05-23 13:33   ` Martin Peschke
2006-05-24 21:16 ` Tim Bird
2006-06-01  8:40   ` Martin Peschke
2006-06-01  8:50     ` Andrew Morton

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=20060524150830.3864ae90.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mp3@de.ibm.com \
    --cc=tglx@linutronix.de \
    /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