Re: [PATCH 01/16] math128: Introduce various 128bit primitives

From: Peter Zijlstra
Date: Thu Oct 25 2012 - 09:47:46 EST


On Wed, 2012-10-24 at 16:18 -0700, Linus Torvalds wrote:
> On Wed, Oct 24, 2012 at 2:53 PM, Juri Lelli <juri.lelli@xxxxxxxxx> wrote:
> > From: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> >
> > Grow rudimentary u128 support without relying on gcc/libgcc.
>
> I missed the part where somebody explains why and what needs this?
> It's going to be very expensive indeed on some platforms, so the fact
> that it is *sometimes* cheap doesn't necessarily imply it should ever
> be used.
>
> So please, explain what the pressing need is that is so worthwhile
> that this is worth it. Maybe it was in a 00/16 cover letter, but not
> only was that not sent out to the people who got 01, you'd still want
> it in the commit message.

There's two use cases:

1) the proposed SCHED_DEADLINE needs to do some u64xu64 math, it
ends up having to multiply a deadline (in usec) with runtime (also
in usec).

2) the infrastructure adds mul_u64_u32_shr(), which is something we
do a lot of with all the time manipulation, apply a multiplier to
some u64 clock value.

We can do better on some archs than we can in generic, so this
interface could give a win there.


But yes, in general people should be very very reluctant to use this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/