[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <63386a3d0906010046k3b86d70av3e290fc26c2934f5@mail.gmail.com>
Date: Mon, 1 Jun 2009 09:46:03 +0200
From: Linus Walleij <linus.ml.walleij@...il.com>
To: Peter Zijlstra <peterz@...radead.org>,
Russell King - ARM Linux <linux@....linux.org.uk>
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu,
linux-arm-kernel@...ts.arm.linux.org.uk
Subject: Re: [PATCH] U300 sched_clock implementation
2009/5/25 Peter Zijlstra <peterz@...radead.org>:
> On Mon, 2009-05-25 at 14:13 +0200, Linus Walleij wrote:
>> 2009/5/24 Peter Zijlstra <peterz@...radead.org>:
>>
>> > On Sat, 2009-05-23 at 23:46 +0200, Linus Walleij wrote:
>> >
>> >> This overrides the global sched_clock() symbol in the Linux
>> >> scheduler with a local implementation which takes advantage of
>> >> the timesource in U300 giving a scheduling resolution of 1us. The
>> >> solution is the same as found in the OMAP2 core code.
>> >
>> > We assume sched_clock() to return time in ns (e-9) resolution.
>>
>> Yep okay and in this case:
>>
>> >> + ret = (unsigned long long) u300_get_cycles();
>> >> + ret = (ret * clocksource_u300_1mhz.mult_orig) >>
>> >> + clocksource_u300_1mhz.shift;
>> >> + return ret;
>>
>> (mult_orig >> shift) == 1000
>
> Ah, ok -- missed that little detail ;-)
>
>> So for each cycle in cyclecount register we return 1000 * cycles
>> i.e 1000ns.
>>
>> If it looks nicer we can of course simply:
>> return (unsigned long long) u300_get_cycles * 1000;
>>
>> But the question here is whether this resolution is enough for
>> sched_clock() or if it is irrelevant to override sched_clock()
>> if it cannot schedule with better precision than 1000 ns.
>
> No anything better than jiffies is good, 1us certainly is worth the
> trouble.
Can I interpret this as Acked-by: Peter Zijlstra <peterz@...radead.org> ?
Russell wanted an indication from the scheduler people that it looked sane...
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists