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

From: Anshuman Khandual <[email-masked]>
Date: Wed, 12 Aug 2015 14:08:07 +0530

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)

With    the 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.