Subject: Re: [PATCH] powerpc: Avoid taking a data miss on every userspace instruction miss

From: Michael Ellerman <[email-masked]>
Date: Thu, 13 Apr 2017 20:22:40 +1000

Christophe LEROY <[email-masked]> writes:

> Hi Anton,
>
> Le 04/04/2017 à 00:00, Anton Blanchard a écrit :
>> Hi Christophe,
>>
>>>> -	if (user_mode(regs))
>>>> +	if (!is_exec && user_mode(regs))
>>>
>>> Shouldn't it also check 'is_write' ?
>>> If it is a store, is_write should be set, shouldn't it ?
>>
>> Thanks, Ben had the same suggestion. I'll add that further optimisation
>> in a subsequent patch.
>>
>
> For your information, I made some benchmark test using 'perf stat' with 
> your app on MPC8321 and MPC885, and I got the following results:

 MPC8321:
 before        47386      faults 
 after         35181      faults        -12205
 is_write      35181      faults        -12205 

So that's good.

 MPC885:
 before:      176067      dTLB-load-misses 
               52722      iTLB-load-misses 
               25718      faults 
 after:       152462      dTLB-load-misses    -23605
               52715      iTLB-load-misses        -7
               19611      faults               -6107

 is_write:    147162      dTLB-load-misses    -28905
               52716      iTLB-load-misses        -6
               19610      faults               -6108

Also good, and shows that is_write idea would be even better.

cheers