Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: mvneta: reduce smp_processor_id() calling in mvneta_tx_done_gbe
In the loop of mvneta_tx_done_gbe(), we call the smp_processor_id() each time, move the call out of the loop to optimize the code a bit. Before the patch, the loop looks like(under arm64): ldr x1, [x29,torvalds#120] ... ldr w24, [x1,torvalds#36] ... bl 0 <_raw_spin_lock> str w24, [x27,torvalds#132] ... After the patch, the loop looks like(under arm64): ... bl 0 <_raw_spin_lock> str w23, [x28,torvalds#132] ... where w23 is loaded so be ready before the loop. >From another side, mvneta_tx_done_gbe() is called from mvneta_poll() which is in non-preemptible context, so it's safe to call the smp_processor_id() function once. Signed-off-by: Jisheng Zhang <[email protected]> Reviewed-by: Gregory CLEMENT <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information