Re: performance: memcpy vs. __copy_tofrom_user

2008-10-13 Thread Benjamin Herrenschmidt
> There should definitely be a nice API for an in-kernel AltiVec context > save/restore. When preemption happens doesn't it do some equivalent of > the userspace context switch? Why can't the preemption system take care > of it? > > At worst case you make the worst case latency bigger, but at bes

Re: performance: memcpy vs. __copy_tofrom_user

2008-10-13 Thread Matt Sealey
Scott Wood wrote: Benjamin Herrenschmidt wrote: Yuck. Hmm? It's simple and achieves the desired result (avoiding non-preemptible regions without unduly restricting the ability to extract performance from the hardware). Would it be nicer to avoid FP/Altivec in the kernel altogether? Sure

Re: performance: memcpy vs. __copy_tofrom_user

2008-10-13 Thread Scott Wood
Benjamin Herrenschmidt wrote: It doesn't need to be done in non-preemptible sections, if you have a separate per-thread save area for kernel fp/altivec use (and appropriate flags so an FP unavailable handler knows which regs to restore), and you can avoid using it in a preempting context. Yuck.

RE: [PATCH] remove bogus ppc_select syscall

2008-10-13 Thread Paul Mackerras
Sadashiiv, Halesh writes: > I have tested the testcase that I have provided at the time of reporting > this issue. But it didn't work as expected with the above patch you > provided. > (Failed to return EINVAL on negative value of n to select()) How is your testcase invoking select? Is it doing

Re: performance: memcpy vs. __copy_tofrom_user

2008-10-13 Thread Benjamin Herrenschmidt
> It doesn't need to be done in non-preemptible sections, if you have a > separate per-thread save area for kernel fp/altivec use (and appropriate > flags so an FP unavailable handler knows which regs to restore), and you > can avoid using it in a preempting context. Yuck. Ben. ___

Re: performance: memcpy vs. __copy_tofrom_user

2008-10-13 Thread Scott Wood
On Sat, Oct 11, 2008 at 09:05:49PM -0500, Matt Sealey wrote: > Benjamin Herrenschmidt wrote: > >The reason where we require a -real-good- reason to do it is > >simply because of the drawbacks. The cost of enabling altivec > >in the kernel can be high (especially if the user is using it) > >and it's

Re: performance: memcpy vs. __copy_tofrom_user

2008-10-13 Thread Scott Wood
On Sun, Oct 12, 2008 at 09:32:07AM +1100, Benjamin Herrenschmidt wrote: > On Wed, 2008-10-08 at 12:40 -0500, Scott Wood wrote: > > > > The performance difference most likely comes from the fact that copy > > to/from user can assume that the memory is cacheable, while memcpy is > > occasionally u

RE: [PATCH] remove bogus ppc_select syscall

2008-10-13 Thread Sadashiiv, Halesh
>>Please don't apply Arnd's patch. As I said, all we need is this >>one-line change in arch/powerpc/include/asm/systbl.h: >> >>-SYSX_SPU(sys_select,ppc32_select,ppc_select) >>+SYSX_SPU(sys_select,ppc32_select,sys_select) > > >I have tested the testcase that I have provided at the time of report

RE: [PATCH] remove bogus ppc_select syscall

2008-10-13 Thread Sadashiiv, Halesh
>-Original Message- >From: Paul Mackerras [mailto:[EMAIL PROTECTED] >Sent: Friday, October 10, 2008 1:14 PM >To: [EMAIL PROTECTED] >Cc: Arnd Bergmann; linuxppc-embedded@ozlabs.org; Sadashiiv, Halesh; >[EMAIL PROTECTED] >Subject: Re: [PATCH] remove bogus ppc_select syscall > >Benjamin Herr