Skip to content

IPI: Avoid to use 2 cache lines for one call_single_data

Huang, Ying linux-iommu lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3percpu: Add alloc_percpu_aligned()include/linux/percpu.h+3 -02 replies
2/3iova: Use alloc_percpu_aligned()drivers/iommu/iova.c+1 -10 replies
3/3IPI: Avoid to use 2 cache lines for one call_single_datakernel/smp.c+4 -214 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] IPI: Avoid to use 2 cache lines for one call_single_data

From: Huang Ying <[email protected]>

struct call_single_data is used in IPI to transfer information between CPUs. Its size is bigger than sizeof(unsigned long) and less than cache line size. Now, it is allocated with no any alignment requirement. This makes it possible for allocated call_single_data to cross 2 cache lines. So that double the number of the cache lines that need to be transferred among CPUs. This is resolved by aligning the allocated call_single_data with cache line size.

To allocate cache line size aligned percpu memory dynamically, alloc_percpu_aligned() is introduced and used in iova drivers too.

To test the effect of the patch, we use 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 IPI will be triggered when unmapping memory. In the test, the throughput of memory writing improves ~5% compared with misaligned call_single_data because of faster IPI.

Best Regards,
Huang, Ying