Re: [V3] powerpc/irq: Enable some more exceptions in /proc/interrupts interface

2015-08-19 Thread Anshuman Khandual
On 08/14/2015 08:22 AM, Michael Ellerman wrote:
> On Thu, 2015-08-06 at 18:54 +0530, Anshuman Khandual wrote:
>> On 08/04/2015 03:27 PM, Michael Ellerman wrote:
>>> On Mon, 2015-13-07 at 08:16:06 UTC, Anshuman Khandual wrote:
 This patch enables facility unavailable exceptions for generic facility,
 FPU, ALTIVEC and VSX in /proc/interrupts listing by incrementing their
 newly added IRQ statistical counters as and when these exceptions happen.
 This also adds couple of helper functions which will be called from within
 the interrupt handler context to update their statistics. Similarly this
 patch also enables alignment and program check exceptions as well.
>>>
>>> ...
>>>
 diff --git a/arch/powerpc/kernel/exceptions-64s.S 
 b/arch/powerpc/kernel/exceptions-64s.S
 index 0a0399c2..a86180c 100644
 --- a/arch/powerpc/kernel/exceptions-64s.S
 +++ b/arch/powerpc/kernel/exceptions-64s.S
 @@ -1158,6 +1158,7 @@ BEGIN_FTR_SECTION
  END_FTR_SECTION_IFSET(CPU_FTR_TM)
  #endif
bl  load_up_fpu
 +  bl  fpu_unav_exceptions_count
>>>
>>> Is it safe to call C code here?
>>
>> Hmm, is it not ? I had that question but was not really sure. Dont
>> understand the difference between 'fast_exception_return' and
>> 'ret_from_except' completely.
> 
> If you're "not really sure" it's correct, please say so in the change log!

Yeah I should have written that up some where after the commit
message (after "---"). Its my bad, will take care of this next
time around.

> 
> I'd rather you didn't send me patches with possibly subtle bugs in core code.

Michael, I understand your concern. I was just trying to add
new entries in there which would help us. Wondering whats our
plan for this patch, if we change it as I had proposed earlier,
will it be good enough.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [V3] powerpc/irq: Enable some more exceptions in /proc/interrupts interface

2015-08-13 Thread Michael Ellerman
On Thu, 2015-08-06 at 18:54 +0530, Anshuman Khandual wrote:
> On 08/04/2015 03:27 PM, Michael Ellerman wrote:
> > On Mon, 2015-13-07 at 08:16:06 UTC, Anshuman Khandual wrote:
> >> This patch enables facility unavailable exceptions for generic facility,
> >> FPU, ALTIVEC and VSX in /proc/interrupts listing by incrementing their
> >> newly added IRQ statistical counters as and when these exceptions happen.
> >> This also adds couple of helper functions which will be called from within
> >> the interrupt handler context to update their statistics. Similarly this
> >> patch also enables alignment and program check exceptions as well.
> > 
> > ...
> > 
> >> diff --git a/arch/powerpc/kernel/exceptions-64s.S 
> >> b/arch/powerpc/kernel/exceptions-64s.S
> >> index 0a0399c2..a86180c 100644
> >> --- a/arch/powerpc/kernel/exceptions-64s.S
> >> +++ b/arch/powerpc/kernel/exceptions-64s.S
> >> @@ -1158,6 +1158,7 @@ BEGIN_FTR_SECTION
> >>  END_FTR_SECTION_IFSET(CPU_FTR_TM)
> >>  #endif
> >>bl  load_up_fpu
> >> +  bl  fpu_unav_exceptions_count
> > 
> > Is it safe to call C code here?
> 
> Hmm, is it not ? I had that question but was not really sure. Dont
> understand the difference between 'fast_exception_return' and
> 'ret_from_except' completely.

If you're "not really sure" it's correct, please say so in the change log!

I'd rather you didn't send me patches with possibly subtle bugs in core code.

cheers



___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [V3] powerpc/irq: Enable some more exceptions in /proc/interrupts interface

2015-08-12 Thread Anshuman Khandual
On 08/09/2015 07:57 AM, Benjamin Herrenschmidt wrote:
> On Tue, 2015-08-04 at 19:57 +1000, Michael Ellerman wrote:
>> > On Mon, 2015-13-07 at 08:16:06 UTC, Anshuman Khandual wrote:
>>> > > This patch enables facility unavailable exceptions for generic facility,
>>> > > FPU, ALTIVEC and VSX in /proc/interrupts listing by incrementing their
>>> > > newly added IRQ statistical counters as and when these exceptions 
>>> > > happen.
>>> > > This also adds couple of helper functions which will be called from 
>>> > > within
>>> > > the interrupt handler context to update their statistics. Similarly this
>>> > > patch also enables alignment and program check exceptions as well.
>> > 
>> > ...
>> > 
>>> > > diff --git a/arch/powerpc/kernel/exceptions-64s.S 
>>> > > b/arch/powerpc/kernel/exceptions-64s.S
>>> > > index 0a0399c2..a86180c 100644
>>> > > --- a/arch/powerpc/kernel/exceptions-64s.S
>>> > > +++ b/arch/powerpc/kernel/exceptions-64s.S
>>> > > @@ -1158,6 +1158,7 @@ BEGIN_FTR_SECTION
>>> > >  END_FTR_SECTION_IFSET(CPU_FTR_TM)
>>> > >  #endif
>>> > > bl  load_up_fpu
>>> > > +   bl  fpu_unav_exceptions_count
>> > 
>> > Is it safe to call C code here?
> Even if it was (at some stage it wasn't, I'd have to look very closely
> to see what's the situation now), we certainly don't want to add
> overhead to load_up_fpu.

As I had already mentioned in the V2 thread of this patch, the
FPU performance with this patch being applied is still very much
comparable to the kernel without this patch. Though I have not
verified whether this still holds true with the new changes being
proposed in exceptions-64s.S (earlier reply in this thread) to
make the C function call safer.

Average of 1000 iterations (context_switch2 --fp 0 0)

Withthe patch : 322599.57  (Average of 1000 results)
Without the patch : 320464.924 (Average of 1000 results)

With standard deviation of the results.

6029.1407073288 (with patch ) 5941.7684079774 (without patch)

Wondering if the result above still does not convince us
that FPU performance might not be getting hit because of
this patch, let me know if we need to do more experiments.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [V3] powerpc/irq: Enable some more exceptions in /proc/interrupts interface

2015-08-08 Thread Benjamin Herrenschmidt
On Tue, 2015-08-04 at 19:57 +1000, Michael Ellerman wrote:
> On Mon, 2015-13-07 at 08:16:06 UTC, Anshuman Khandual wrote:
> > This patch enables facility unavailable exceptions for generic facility,
> > FPU, ALTIVEC and VSX in /proc/interrupts listing by incrementing their
> > newly added IRQ statistical counters as and when these exceptions happen.
> > This also adds couple of helper functions which will be called from within
> > the interrupt handler context to update their statistics. Similarly this
> > patch also enables alignment and program check exceptions as well.
> 
> ...
> 
> > diff --git a/arch/powerpc/kernel/exceptions-64s.S 
> > b/arch/powerpc/kernel/exceptions-64s.S
> > index 0a0399c2..a86180c 100644
> > --- a/arch/powerpc/kernel/exceptions-64s.S
> > +++ b/arch/powerpc/kernel/exceptions-64s.S
> > @@ -1158,6 +1158,7 @@ BEGIN_FTR_SECTION
> >  END_FTR_SECTION_IFSET(CPU_FTR_TM)
> >  #endif
> > bl  load_up_fpu
> > +   bl  fpu_unav_exceptions_count
> 
> Is it safe to call C code here?

Even if it was (at some stage it wasn't, I'd have to look very closely
to see what's the situation now), we certainly don't want to add
overhead to load_up_fpu.

> > b   fast_exception_return
> >  #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
> >  2: /* User process was in a transaction */
> 
> 
> cheers
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [V3] powerpc/irq: Enable some more exceptions in /proc/interrupts interface

2015-08-06 Thread Anshuman Khandual
On 08/04/2015 03:27 PM, Michael Ellerman wrote:
> On Mon, 2015-13-07 at 08:16:06 UTC, Anshuman Khandual wrote:
>> This patch enables facility unavailable exceptions for generic facility,
>> FPU, ALTIVEC and VSX in /proc/interrupts listing by incrementing their
>> newly added IRQ statistical counters as and when these exceptions happen.
>> This also adds couple of helper functions which will be called from within
>> the interrupt handler context to update their statistics. Similarly this
>> patch also enables alignment and program check exceptions as well.
> 
> ...
> 
>> diff --git a/arch/powerpc/kernel/exceptions-64s.S 
>> b/arch/powerpc/kernel/exceptions-64s.S
>> index 0a0399c2..a86180c 100644
>> --- a/arch/powerpc/kernel/exceptions-64s.S
>> +++ b/arch/powerpc/kernel/exceptions-64s.S
>> @@ -1158,6 +1158,7 @@ BEGIN_FTR_SECTION
>>  END_FTR_SECTION_IFSET(CPU_FTR_TM)
>>  #endif
>>  bl  load_up_fpu
>> +bl  fpu_unav_exceptions_count
> 
> Is it safe to call C code here?

Hmm, is it not ? I had that question but was not really sure. Dont
understand the difference between 'fast_exception_return' and
'ret_from_except' completely. Will converting the following sequence
of code

bl  load_up_fpu
+   bl  fpu_unav_exceptions_count
b   fast_exception_return

into

bl  load_up_fpu
RECONCILE_IRQ_STATE(r10, r11)
addir3,r1,STACK_FRAME_OVERHEAD
+   bl  fpu_unav_exceptions_count
b   ret_from_except

help solve the problem ?

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [V3] powerpc/irq: Enable some more exceptions in /proc/interrupts interface

2015-08-04 Thread Michael Ellerman
On Mon, 2015-13-07 at 08:16:06 UTC, Anshuman Khandual wrote:
> This patch enables facility unavailable exceptions for generic facility,
> FPU, ALTIVEC and VSX in /proc/interrupts listing by incrementing their
> newly added IRQ statistical counters as and when these exceptions happen.
> This also adds couple of helper functions which will be called from within
> the interrupt handler context to update their statistics. Similarly this
> patch also enables alignment and program check exceptions as well.

...

> diff --git a/arch/powerpc/kernel/exceptions-64s.S 
> b/arch/powerpc/kernel/exceptions-64s.S
> index 0a0399c2..a86180c 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -1158,6 +1158,7 @@ BEGIN_FTR_SECTION
>  END_FTR_SECTION_IFSET(CPU_FTR_TM)
>  #endif
>   bl  load_up_fpu
> + bl  fpu_unav_exceptions_count

Is it safe to call C code here?

>   b   fast_exception_return
>  #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
>  2:   /* User process was in a transaction */


cheers
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev