From: Gabriel C <nix.or.die@googlemail.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
hinko.kocevar@cetrtapot.si
Subject: Re: CONFIG_PRINTK_TIME broken on git HEAD ?
Date: Fri, 09 May 2008 14:13:45 +0200 [thread overview]
Message-ID: <48243FF9.6040300@googlemail.com> (raw)
In-Reply-To: <1210325973.13978.216.camel@twins>
Peter Zijlstra wrote:
> On Thu, 2008-05-08 at 13:21 +0200, Gabriel C wrote:
>
>>> Ok, so the issue is that the clock doesn't start at 0, but at:
>>> 4294014.506571 ?
>> At least on my box , yes.
>>
>
> Does this work for you?
No it does not , I still get :
....
[ 0.000000] PERCPU: Allocating 42756 bytes of per cpu data
[ 0.000000] NR_CPUS: 8, nr_cpu_ids: 4
[4294014.506571] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 1010723
...
>
> ---
>
> Subject: sched: fixup sched-clock offset
> From: Peter Zijlstra <a.p.zijlstra@chello.nl>
>
> It could happen that ktime doesn't start at 0.
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> kernel/sched_clock.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> Index: linux-2.6-2/kernel/sched_clock.c
> ===================================================================
> --- linux-2.6-2.orig/kernel/sched_clock.c
> +++ linux-2.6-2/kernel/sched_clock.c
> @@ -59,21 +59,23 @@ static inline struct sched_clock_data *c
> return &per_cpu(sched_clock_data, cpu);
> }
>
> +static __read_mostly u64 ktime_offset;
> +
> void sched_clock_init(void)
> {
> - u64 ktime_now = ktime_to_ns(ktime_get());
> - u64 now = 0;
> int cpu;
>
> + ktime_offset = ktime_to_ns(ktime_get());
> +
> for_each_possible_cpu(cpu) {
> struct sched_clock_data *scd = cpu_sdc(cpu);
>
> scd->lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
> scd->prev_jiffies = jiffies;
> - scd->prev_raw = now;
> - scd->tick_raw = now;
> - scd->tick_gtod = ktime_now;
> - scd->clock = ktime_now;
> + scd->prev_raw = 0;
> + scd->tick_raw = 0;
> + scd->tick_gtod = 0;
> + scd->clock = 0;
> }
> }
>
> @@ -177,7 +179,7 @@ void sched_clock_tick(void)
> WARN_ON_ONCE(!irqs_disabled());
>
> now = sched_clock();
> - now_gtod = ktime_to_ns(ktime_get());
> + now_gtod = ktime_to_ns(ktime_get()) - ktime_offset;
>
> __raw_spin_lock(&scd->lock);
> __update_sched_clock(scd, now);
>
>
>
prev parent reply other threads:[~2008-05-09 12:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-07 22:26 CONFIG_PRINTK_TIME broken on git HEAD ? Gabriel C
2008-05-07 22:41 ` Andrew Morton
2008-05-07 22:57 ` Gabriel C
2008-05-08 11:00 ` Gabriel C
2008-05-08 11:13 ` Peter Zijlstra
2008-05-08 11:21 ` Gabriel C
2008-05-09 9:39 ` Peter Zijlstra
2008-05-09 9:42 ` Ingo Molnar
2008-05-09 12:21 ` Gabriel C
2008-05-09 12:13 ` Gabriel C [this message]
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=48243FF9.6040300@googlemail.com \
--to=nix.or.die@googlemail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=hinko.kocevar@cetrtapot.si \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rjw@sisk.pl \
--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