]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Remove redundant mov from LL/SC cmpxchg
authorRobin Murphy <robin.murphy@arm.com>
Fri, 12 May 2017 12:48:41 +0000 (13:48 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 15 May 2017 17:30:10 +0000 (18:30 +0100)
commitc89846ff77af9ab6c021e02877c5ca5596fc320b
treedf8284b2f7d13200752c5afbbbd98474d256af8c
parent6a0fa58cdd92da9a8e6fa4e621cabd91974091b3
arm64: Remove redundant mov from LL/SC cmpxchg

The cmpxchg implementation introduced by commit 4cca0511a9dc ("arm64:
cmpxchg: patch in lse instructions when supported by the CPU") performs
an apparently redundant register move of [old] to [oldval] in the
success case - it always uses the same register width as [oldval] was
originally loaded with, and is only executed when [old] and [oldval] are
known to be equal anyway.

The only effect it seemingly does have is to take up a surprising amount
of space in the kernel text, as removing it reveals:

   text    data     bss     dec     hex filename
12426658 1348614 4499749 18275021 116dacd vmlinux.o.new
12429238 1348614 4499749 18277601 116e4e1 vmlinux.o.old

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/atomic_ll_sc.h