Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2020-01-10 Thread Thomas Gleixner
Christophe, Christophe Leroy writes: > On 01/09/2020 02:05 PM, Thomas Gleixner wrote: >> The reason why this is implemented in this way is that >> __arch_get_hw_counter() needs a way to express that the clocksource of >> the moment is not suitable for VDSO so that the syscall fallback gets >>

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2020-01-09 Thread Christophe Leroy
Hi Thomas, On 01/09/2020 02:05 PM, Thomas Gleixner wrote: Christophe! Christophe Leroy writes: In do_hres(), I see: cycles = __arch_get_hw_counter(vd->clock_mode); ns = vdso_ts->nsec; last = vd->cycle_last; if

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2020-01-09 Thread Thomas Gleixner
Christophe! Christophe Leroy writes: > In do_hres(), I see: > > cycles = __arch_get_hw_counter(vd->clock_mode); > ns = vdso_ts->nsec; > last = vd->cycle_last; > if (unlikely((s64)cycles < 0)) > return -1; > >

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-12-20 Thread Christophe Leroy
Hi Thomas, In do_hres(), I see: cycles = __arch_get_hw_counter(vd->clock_mode); ns = vdso_ts->nsec; last = vd->cycle_last; if (unlikely((s64)cycles < 0)) return -1; __arch_get_hw_counter() returns a u64

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-27 Thread Segher Boessenkool
On Sun, Oct 27, 2019 at 10:21:25AM +0100, Christophe Leroy wrote: > Le 27/10/2019 à 01:06, Segher Boessenkool a écrit : > >The hand-optimised asm code will pretty likely win handsomely, whatever > >you do. Especially on cores like the 885 (no branch prediction, single > >issue, small caches,

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-27 Thread Christophe Leroy
Le 27/10/2019 à 01:06, Segher Boessenkool a écrit : On Sat, Oct 26, 2019 at 08:48:27PM +0200, Thomas Gleixner wrote: On Sat, 26 Oct 2019, Christophe Leroy wrote: Let's look at the code: __cvdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) { const struct

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-26 Thread Segher Boessenkool
On Sat, Oct 26, 2019 at 08:48:27PM +0200, Thomas Gleixner wrote: > On Sat, 26 Oct 2019, Christophe Leroy wrote: > Let's look at the code: > > __cvdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) > { > const struct vdso_data *vd = __arch_get_vdso_data(); > >

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-26 Thread Thomas Gleixner
On Sat, 26 Oct 2019, Christophe Leroy wrote: > Le 26/10/2019 à 17:53, Thomas Gleixner a écrit : > > > > > > gettimeofday:    vdso: 750 nsec/call > > > > > > > > > > > > gettimeofday:    vdso: 1533 nsec/call > > > > > > > > Small improvement (3%) with the proposed change: > > > > > > > >

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-26 Thread Christophe Leroy
Le 26/10/2019 à 17:53, Thomas Gleixner a écrit : On Tue, 22 Oct 2019, Christophe Leroy wrote: Le 22/10/2019 à 11:01, Christophe Leroy a écrit : Le 21/10/2019 à 23:29, Thomas Gleixner a écrit : On Mon, 21 Oct 2019, Christophe Leroy wrote: This is a tentative to switch powerpc/32 vdso to

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-26 Thread Christophe Leroy
Le 26/10/2019 à 15:55, Andy Lutomirski a écrit : On Tue, Oct 22, 2019 at 6:56 AM Christophe Leroy wrote: The performance is rather disappoiting. That's most likely all calculation in the C implementation are based on 64 bits math and converted to 32 bits at the very end. I guess C

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-26 Thread Thomas Gleixner
On Tue, 22 Oct 2019, Christophe Leroy wrote: > Le 22/10/2019 à 11:01, Christophe Leroy a écrit : > > Le 21/10/2019 à 23:29, Thomas Gleixner a écrit : > > > On Mon, 21 Oct 2019, Christophe Leroy wrote: > > > > > > > This is a tentative to switch powerpc/32 vdso to generic C > > > > implementation.

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-26 Thread Andy Lutomirski
On Tue, Oct 22, 2019 at 6:56 AM Christophe Leroy wrote: > > > >>> The performance is rather disappoiting. That's most likely all > >>> calculation in the C implementation are based on 64 bits math and > >>> converted to 32 bits at the very end. I guess C implementation should > >>> use 32 bits

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-22 Thread Christophe Leroy
Le 22/10/2019 à 11:01, Christophe Leroy a écrit : Le 21/10/2019 à 23:29, Thomas Gleixner a écrit : On Mon, 21 Oct 2019, Christophe Leroy wrote: This is a tentative to switch powerpc/32 vdso to generic C implementation. It will likely not work on 64 bits or even build properly at the

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-22 Thread Christophe Leroy
Le 21/10/2019 à 23:29, Thomas Gleixner a écrit : On Mon, 21 Oct 2019, Christophe Leroy wrote: This is a tentative to switch powerpc/32 vdso to generic C implementation. It will likely not work on 64 bits or even build properly at the moment. powerpc is a bit special for VDSO as well as

Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-21 Thread Thomas Gleixner
On Mon, 21 Oct 2019, Christophe Leroy wrote: > This is a tentative to switch powerpc/32 vdso to generic C implementation. > It will likely not work on 64 bits or even build properly at the moment. > > powerpc is a bit special for VDSO as well as system calls in the > way that it requires setting

[RFC PATCH] powerpc/32: Switch VDSO to C implementation.

2019-10-21 Thread Christophe Leroy
This is a tentative to switch powerpc/32 vdso to generic C implementation. It will likely not work on 64 bits or even build properly at the moment. powerpc is a bit special for VDSO as well as system calls in the way that it requires setting CR SO bit which cannot be done in C. Therefore,