Re: + zram-use-try_cmpxchg-in-update_used_max.patch added to mm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On (22/10/18 13:50), Andrew Morton wrote:
> Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in
> update_used_max.  x86 CMPXCHG instruction returns success in ZF flag, so
> this change saves a compare after cmpxchg (and related move instruction in
> front of cmpxchg).
> 
> Also, reorder code a bit to remove additional compare and conditional jump
> from the assembly code.  Together, hese two changes save 15 bytes from the
> function when compiled for x86_64.
> 
> No functional change intended.
> 
> Link: https://lkml.kernel.org/r/20221018145154.3699-1-ubizjak@xxxxxxxxx
> Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
> Cc: Minchan Kim <minchan@xxxxxxxxxx>
> Cc: Nitin Gupta <ngupta@xxxxxxxxxx>
> Cc: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

I totally missed that patch.

Reviewed-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux