[Linux-Xtensa] Re: sched_clock always 0 and no process time accounting with 3.11-rc1

Marc Gauthier Marc.Gauthier at tensilica.com
Wed Jul 17 12:17:19 EDT 2013


Russell King - ARM Linux wrote:
> On Wed, Jul 17, 2013 at 08:15:08AM -0700, Marc Gauthier wrote:
> > Hi Baruch,
> >
> > On 2013-07-16, at 11:19 PM, Baruch Siach <baruch at tkos.co.il> wrote:
> > > -    sched_clock_mask = (1 << bits) - 1;
> > > +    sched_clock_mask = (1ULL << bits) - 1;
> >
> > Might it be more efficient to use:
> >
> >    sched_clock_mask = 0xffffffff >> (32 - bits);
> >
> > to avoid using 64 bit ints?
> > (assuming bits > 0, didn't check)
>
> bits being 0 would be rather silly (it implies a mask of
> zero, and therefore
> no bits available for the clock.)  We could modify the
> BUG_ON() above to
> make that point, or add it as commentry against the function.

Sounds good.


> Given that, and that sched_clock_mask is a u32, then I agree
> with you - the above would be a better way to do this.

> Personally, I'd suggest ~0u rather
> than 0xffffffff because its less typing.

Am not sure though, on machines with 64-bit int, ~0u might
end up being 0xffffffffffffffff which is unintended.

-Marc



More information about the linux-arm-kernel mailing list