Skip to contentSkip to conversation

bpf: align struct bpf_prog_stats

PATCH Applied Eric Dumazet 2 participants 2 messages Oct 11, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: align struct bpf_prog_stats

Do not risk spanning these small structures on two cache lines.

---
 include/linux/bpf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/bpf.h +1 -1
index 5b9d2233860654512da6ff5ec8bf56f2343ed722..282e28bf41ec627cad63c6b5bc3f439dc5f58f56 100644
@@ -363,7 +363,7 @@ struct bpf_prog_stats {
 	u64 cnt;
 	u64 nsecs;
 	struct u64_stats_sync syncp;
-};
+} __aligned(2 * sizeof(u64));
 
 struct bpf_prog_aux {
 	atomic_t refcnt;
Signature · 1 line
2.23.0.700.g56cf767bdb-goog