* [PATCH net-next] fib_rules: reorder struct fib_rules fields
@ 2013-08-03 18:50 Eric Dumazet
2013-08-03 18:54 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2013-08-03 18:50 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Stefan Tomanek
From: Eric Dumazet <edumazet@google.com>
Move refcnt, pref, suppress_ifgroup, suppress_prefixlen out of first
cache line, as they are not used in fast path.
Make sure ctarget & fr_net are in first cache line.
(Assuming 64 bit arches and 64 bytes cache lines)
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/fib_rules.h | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index 9d0fcbaa..4b2b557 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -10,23 +10,25 @@
struct fib_rule {
struct list_head list;
- atomic_t refcnt;
int iifindex;
int oifindex;
u32 mark;
u32 mark_mask;
- u32 pref;
u32 flags;
u32 table;
- int suppress_ifgroup;
- int suppress_prefixlen;
u8 action;
+ /* 3 bytes hole, try to use */
u32 target;
struct fib_rule __rcu *ctarget;
+ struct net *fr_net;
+
+ atomic_t refcnt;
+ u32 pref;
+ int suppress_ifgroup;
+ int suppress_prefixlen;
char iifname[IFNAMSIZ];
char oifname[IFNAMSIZ];
struct rcu_head rcu;
- struct net * fr_net;
};
struct fib_lookup_arg {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] fib_rules: reorder struct fib_rules fields
2013-08-03 18:50 [PATCH net-next] fib_rules: reorder struct fib_rules fields Eric Dumazet
@ 2013-08-03 18:54 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-08-03 18:54 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, stefan.tomanek
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 03 Aug 2013 11:50:35 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> Move refcnt, pref, suppress_ifgroup, suppress_prefixlen out of first
> cache line, as they are not used in fast path.
>
> Make sure ctarget & fr_net are in first cache line.
>
> (Assuming 64 bit arches and 64 bytes cache lines)
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-03 18:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-03 18:50 [PATCH net-next] fib_rules: reorder struct fib_rules fields Eric Dumazet
2013-08-03 18:54 ` David Miller
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).