netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: align struct bpf_prog_stats
@ 2019-10-11 18:11 Eric Dumazet
  2019-10-11 21:23 ` Daniel Borkmann
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2019-10-11 18:11 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: David S . Miller, netdev, Eric Dumazet, Eric Dumazet, bpf

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

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/linux/bpf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 5b9d2233860654512da6ff5ec8bf56f2343ed722..282e28bf41ec627cad63c6b5bc3f439dc5f58f56 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -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;
-- 
2.23.0.700.g56cf767bdb-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH bpf-next] bpf: align struct bpf_prog_stats
  2019-10-11 18:11 [PATCH bpf-next] bpf: align struct bpf_prog_stats Eric Dumazet
@ 2019-10-11 21:23 ` Daniel Borkmann
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2019-10-11 21:23 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Alexei Starovoitov, David S . Miller, netdev, Eric Dumazet, bpf

On Fri, Oct 11, 2019 at 11:11:40AM -0700, Eric Dumazet wrote:
> Do not risk spanning these small structures on two cache lines.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-11 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11 18:11 [PATCH bpf-next] bpf: align struct bpf_prog_stats Eric Dumazet
2019-10-11 21:23 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).