flow : Remove an unecessary ____cacheline_aligned
Subsystems (2)
We use a percpu variable named flow_hash_info, which holds 12 bytes.
It is currently marked as ____cacheline_aligned, which makes linker skip space to properly align this variable.
Before :c065cc90 D per_cpu__softnet_datac065cd00 d per_cpu__flow_tables
<Here, hole of 124 bytes>c065cd80 d per_cpu__flow_hash_info
<Here, hole of 116 bytes>c065ce00 d per_cpu__flow_flush_taskletsc065ce14 d per_cpu__rt_cache_stat
This alignement is quite unproductive, and removing it reduces the size of percpu data (by 240 bytes on my x86 machine), and improves performance (flow_tables & flow_hash_info can share a single cache line)
After patch :c065cc04 D per_cpu__softnet_datac065cc4c d per_cpu__flow_tablesc065cc50 d per_cpu__flow_hash_infoc065cc5c d per_cpu__flow_flush_taskletsc065cc70 d per_cpu__rt_cache_stat
net/core/flow.c +1 -1
@@ -52,7 +52,7 @@ struct flow_percpu_info {int hash_rnd_recalc;u32 hash_rnd;int count; -}____cacheline_aligned ; +}; static DEFINE_PER_CPU(struct flow_percpu_info, flow_hash_info) = { 0 };#define flow_hash_rnd_recalc (cpu) \
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Tue, 01 Jan 2008 16:33:33 +0100
Quoted 20 lines
We use a percpu variable named
flow_hash_info, which holds 12 bytes.It is currently marked as
____cacheline_aligned, which makes linker skip space to properly align this variable.Before :
c065cc90Dper_cpu__softnet_datac065cd00dper_cpu__flow_tables
<Here, hole of 124 bytes>c065cd80dper_cpu__flow_hash_info
<Here, hole of 116 bytes>c065ce00dper_cpu__flow_flush_taskletsc065ce14dper_cpu__rt_cache_statThis alignement is quite unproductive, and removing it reduces the size of percpu data (by 240 bytes on my x86 machine), and improves performance (
flow_tables&flow_hash_infocan share a single cache line)
Quoted 8 lines
After patch :
c065cc04Dper_cpu__softnet_datac065cc4cdper_cpu__flow_tablesc065cc50dper_cpu__flow_hash_infoc065cc5cdper_cpu__flow_flush_taskletsc065cc70dper_cpu__rt_cache_statSigned-off-by Eric Dumazet <[email protected]>
Also applied, thanks a lot for these patches Eric.