1
0
Fork 0
remarkable-linux/drivers/net/ethernet/cavium/liquidio
Ying Huang 966a967116 smp: Avoid using two cache lines for struct call_single_data
struct call_single_data is used in IPIs to transfer information between
CPUs.  Its size is bigger than sizeof(unsigned long) and less than
cache line size.  Currently it is not allocated with any explicit alignment
requirements.  This makes it possible for allocated call_single_data to
cross two cache lines, which results in double the number of the cache lines
that need to be transferred among CPUs.

This can be fixed by requiring call_single_data to be aligned with the
size of call_single_data. Currently the size of call_single_data is the
power of 2.  If we add new fields to call_single_data, we may need to
add padding to make sure the size of new definition is the power of 2
as well.

Fortunately, this is enforced by GCC, which will report bad sizes.

To set alignment requirements of call_single_data to the size of
call_single_data, a struct definition and a typedef is used.

To test the effect of the patch, I used the vm-scalability multiple
thread swap test case (swap-w-seq-mt).  The test will create multiple
threads and each thread will eat memory until all RAM and part of swap
is used, so that huge number of IPIs are triggered when unmapping
memory.  In the test, the throughput of memory writing improves ~5%
compared with misaligned call_single_data, because of faster IPIs.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Huang, Ying <ying.huang@intel.com>
[ Add call_single_data_t and align with size of call_single_data. ]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Aaron Lu <aaron.lu@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/87bmnqd6lz.fsf@yhuang-mobile.sh.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-29 15:14:38 +02:00
..
Makefile liquidio CN23XX: VF config setup 2016-11-30 11:03:08 -05:00
cn23xx_pf_device.c liquidio: fix bug in soft reset failure detection 2017-07-06 10:36:03 +01:00
cn23xx_pf_device.h liquidio: allocate RX buffers in OOM conditions in PF and VF 2017-03-22 19:36:43 -07:00
cn23xx_pf_regs.h liquidio CN23XX: fix for new check patch errors 2016-11-15 22:24:40 -05:00
cn23xx_vf_device.c liquidio: replace info-pointer mode with buffer-pointer-only mode 2017-06-18 23:55:46 -04:00
cn23xx_vf_device.h liquidio VF ethtool stats 2016-12-08 18:16:51 -05:00
cn23xx_vf_regs.h liquidio CN23XX: VF register definitions 2016-11-30 11:03:08 -05:00
cn66xx_device.c liquidio: fix bug in soft reset failure detection 2017-07-06 10:36:03 +01:00
cn66xx_device.h liquidio CN23XX: copyrights changes and alignment 2016-11-15 22:24:40 -05:00
cn66xx_regs.h liquidio CN23XX: fix for new check patch errors 2016-11-15 22:24:40 -05:00
cn68xx_device.c liquidio CN23XX: fix for new check patch errors 2016-11-15 22:24:40 -05:00
cn68xx_device.h liquidio CN23XX: copyrights changes and alignment 2016-11-15 22:24:40 -05:00
cn68xx_regs.h liquidio CN23XX: copyrights changes and alignment 2016-11-15 22:24:40 -05:00
lio_core.c liquidio: implement vlan filter enable and disable 2017-06-18 23:53:06 -04:00
lio_ethtool.c liquidio: fix possible eeprom format string overflow 2017-07-14 09:03:11 -07:00
lio_main.c smp: Avoid using two cache lines for struct call_single_data 2017-08-29 15:14:38 +02:00
lio_vf_main.c liquidio: replace info-pointer mode with buffer-pointer-only mode 2017-06-18 23:55:46 -04:00
liquidio_common.h liquidio: replace info-pointer mode with buffer-pointer-only mode 2017-06-18 23:55:46 -04:00
liquidio_image.h liquidio CN23XX: copyrights changes and alignment 2016-11-15 22:24:40 -05:00
octeon_config.h liquidio: replace info-pointer mode with buffer-pointer-only mode 2017-06-18 23:55:46 -04:00
octeon_console.c liquidio: stop using huge static buffer, save 4096k in .data 2017-06-22 11:03:00 -04:00
octeon_device.c liquidio: replace info-pointer mode with buffer-pointer-only mode 2017-06-18 23:55:46 -04:00
octeon_device.h liquidio: fix insmod failure when multiple NICs are plugged in 2017-05-17 14:48:29 -04:00
octeon_droq.c liquidio: replace info-pointer mode with buffer-pointer-only mode 2017-06-18 23:55:46 -04:00
octeon_droq.h smp: Avoid using two cache lines for struct call_single_data 2017-08-29 15:14:38 +02:00
octeon_iq.h liquidio: fix inaccurate count of napi-processed rx packets reported to Octeon 2017-05-26 14:41:48 -04:00
octeon_mailbox.c liquidio: fix rare pci_driver.probe failure of VF driver 2017-05-26 14:41:47 -04:00
octeon_mailbox.h liquidio: fix rare pci_driver.probe failure of VF driver 2017-05-26 14:41:47 -04:00
octeon_main.h sched/wait: Rename wait_queue_t => wait_queue_entry_t 2017-06-20 12:18:27 +02:00
octeon_mem_ops.c liquidio: stop using huge static buffer, save 4096k in .data 2017-06-22 11:03:00 -04:00
octeon_mem_ops.h liquidio: stop using huge static buffer, save 4096k in .data 2017-06-22 11:03:00 -04:00
octeon_network.h liquidio: replace info-pointer mode with buffer-pointer-only mode 2017-06-18 23:55:46 -04:00
octeon_nic.c liquidio: fix VF incorrectly indicating that it successfully set its VLAN 2017-04-08 08:38:41 -07:00
octeon_nic.h liquidio: fix VF incorrectly indicating that it successfully set its VLAN 2017-04-08 08:38:41 -07:00
request_manager.c liquidio: Fix checkpatch errors with references crossing single line 2017-06-02 14:17:17 -04:00
response_manager.c liquidio: fix for vf mac addr command sent to nic firmware 2017-03-21 17:48:29 -07:00
response_manager.h liquidio: fix for vf mac addr command sent to nic firmware 2017-03-21 17:48:29 -07:00