]> git.openfabrics.org - ~emulex/infiniband.git/commit
ARC: [optim] uaccess __{get,put}_user() optimised
authorVineet Gupta <vgupta@synopsys.com>
Fri, 18 Jan 2013 09:42:16 +0000 (15:12 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 11 Feb 2013 14:30:32 +0000 (20:00 +0530)
commit0a5eae458e923af9968679fd75fd1f7670200bc3
tree532c2cc732ce69cb15d1746927415a4cc4cc03fa
parent05d88a493746819821733e07bed918a6e09f735b
ARC: [optim] uaccess __{get,put}_user() optimised

Override asm-generic implementations. We basically gain on 2 fronts

* checks for alignment no longer needed as we are only doing "unit"
  sized copies.

  (Careful observer could argue that While the kernel buffers are aligned,
   the user buffer in theory might not be - however in that case the
   user space is already broken when it tries to deref a hword/word
   straddling word boundary - so we are not making it any worse).

* __copy_{to,from}_user( ) returns bytes that couldn't be copied,
  whereas get_user() returns 0 for success or -EFAULT (not size). Thus
  the code to do leftover bytes calculation can be avoided as well.

The savings were significant: ~17k of code.

bloat-o-meter vmlinux_uaccess_pre vmlinux_uaccess_post
add/remove: 0/4 grow/shrink: 8/118 up/down: 1262/-18758 (-17496)
^^^^^^^^^
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
arch/arc/include/asm/uaccess.h