From: Andi Kleen <ak@suse.de>
To: Roland McGrath <roland@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] cpu-timers: high-resolution CPU clocks for POSIX clock_* syscalls
Date: 14 Dec 2004 20:07:39 +0100 [thread overview]
Message-ID: <p73zn0gzojo.fsf@bragg.suse.de> (raw)
In-Reply-To: <200412140355.iBE3t7KL008040@magilla.sf.frob.com.suse.lists.linux.kernel>
Roland McGrath <roland@redhat.com> writes:
>
> /*
> + * This is called on clock ticks and on context switches.
> + * Bank in p->sched_time the ns elapsed since the last tick or switch.
> + */
> +static void update_cpu_clock(task_t *p, runqueue_t *rq,
> + unsigned long long now)
> +{
> + unsigned long long last = max(p->timestamp, rq->timestamp_last_tick);
> + p->sched_time += now - last;
> +}
This will completely mess up the register allocation in schedule()
long long on i386 forces basically everything else out onto the stack
because it needs 4 aligned registers.
I suspect when you benchmark it it will become visibly slower.
In general it seems like a bad idea to polute the extremly critical
fast paths in schedule with support for such an obscure operation.
Is there really any real need for such a high resolution per process
timer anyways? I have my doubts about it, I would suspect most apps
are more interested in wall clock time.
I don't think this should be merged until a clear need from a useful
application is demonstrated for it.
-Andi
next parent reply other threads:[~2004-12-14 19:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200412140355.iBE3t7KL008040@magilla.sf.frob.com.suse.lists.linux.kernel>
2004-12-14 19:07 ` Andi Kleen [this message]
2004-12-14 22:44 ` [PATCH 1/7] cpu-timers: high-resolution CPU clocks for POSIX clock_* syscalls Ulrich Drepper
2004-12-15 4:51 ` Andi Kleen
2004-12-14 3:55 Roland McGrath
2004-12-14 18:36 ` Christoph Lameter
2004-12-14 21:38 ` Ulrich Drepper
2004-12-14 21:50 ` Roland McGrath
2004-12-14 21:58 ` Christoph Lameter
2004-12-14 22:18 ` Linus Torvalds
2004-12-14 22:26 ` Ulrich Drepper
2004-12-14 22:44 ` Linus Torvalds
2004-12-14 23:08 ` Roland McGrath
2004-12-14 22:14 ` Roland McGrath
2004-12-14 22:23 ` Christoph Lameter
2004-12-15 18:43 ` Christoph Lameter
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=p73zn0gzojo.fsf@bragg.suse.de \
--to=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.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;
as well as URLs for NNTP newsgroup(s).