[PATCH 2/2] powerpc/spufs: stop using access_ok

Christoph Hellwig hch at lst.de
Thu Apr 30 15:39:01 AEST 2020


On Thu, Apr 30, 2020 at 08:39:00AM +0800, Jeremy Kerr wrote:
> Hi Christophe,
> 
> > > Just use the proper non __-prefixed get/put_user variants where
> > > that is not done yet.
> > 
> > But it means you are doing the access_ok() check everytime, which is 
> > what is to be avoided by doing the access_ok() once then using the 
> > __-prefixed variant.
> 
> 5 out of 8 of these are just a access_ok(); simple_read_from_buffer().
> 
> For the cases where it's multiple __put/get_user()s, the max will be 5.
> (for the mbox access). Is that worth optimising the access_ok() checks?

access_ok is just trivial comparism to the segment limit, I don't
think it has a relavant performance impact.


More information about the Linuxppc-dev mailing list