]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sparc64: access tick function from variable
authorPavel Tatashin <pasha.tatashin@oracle.com>
Mon, 12 Jun 2017 20:41:42 +0000 (16:41 -0400)
committerAllen Pais <allen.pais@oracle.com>
Thu, 29 Jun 2017 08:09:43 +0000 (13:39 +0530)
commit5d1a68df3b4cd839aef4f132a28f4e466ff2efd8
treeaf51d2bd6c4c5ba3e17b9677b5051f6a01e8eaf9
parent59a74d4bfaabf50875efc5120e4e1d542010a8d1
sparc64: access tick function from variable

In timer_64.c tick functions are access via pointer (tick_ops), every time
clock is read, there is one extra load to get to the function.

This patch optimizes it, by accessing functions pointer from value.

Current ched_clock():
sethi  %hi(0xb9b400), %g1
ldx  [ %g1 + 0x250 ], %g1  ! <tick_ops>
ldx  [ %g1 ], %g1
call  %g1
nop
sethi  %hi(0xb9b400), %g1
ldx  [ %g1 + 0x300 ], %g1  ! <timer_ticks_per_nsec_quotient>
mulx  %o0, %g1, %g1
rett  %i7 + 8
srlx  %g1, 0xa, %o0

New sched_clock():
sethi  %hi(0xb9b400), %g1
ldx  [ %g1 + 0x340 ], %g1
call  %g1
nop
sethi  %hi(0xb9b400), %g1
ldx  [ %g1 + 0x378 ], %g1
mulx  %o0, %g1, %g1
rett  %i7 + 8
srlx  %g1, 0xa, %o0

Before three loads, now two loads.

Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 24401250
Orabug: 25637776

(cherry picked from commit b8a83fcb78c859b99807af4c8b0ab09f0f827a40)
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/kernel/time_64.c