diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-10-20 18:03:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-21 06:09:41 -0400 |
commit | 9b0c290e78d667e6a483bde8c7cef7dd15f49017 (patch) | |
tree | ed68f6cbcc9a512106217694b16a846147cdf54a /net/ipv4/fib_lookup.h | |
parent | 7b5edbc4cfe2297b0915adea5aa1eafcafadbf06 (diff) |
fib: introduce fib_alias_accessed() helper
Perf tools session at NFWS 2010 pointed out a false sharing on struct
fib_alias that can be avoided pretty easily, if we set FA_S_ACCESSED bit
only if needed (ie : not already set)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_lookup.h')
-rw-r--r-- | net/ipv4/fib_lookup.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h index 5072d8effd5d..a29edf2219c8 100644 --- a/net/ipv4/fib_lookup.h +++ b/net/ipv4/fib_lookup.h | |||
@@ -17,6 +17,13 @@ struct fib_alias { | |||
17 | 17 | ||
18 | #define FA_S_ACCESSED 0x01 | 18 | #define FA_S_ACCESSED 0x01 |
19 | 19 | ||
20 | /* Dont write on fa_state unless needed, to keep it shared on all cpus */ | ||
21 | static inline void fib_alias_accessed(struct fib_alias *fa) | ||
22 | { | ||
23 | if (!(fa->fa_state & FA_S_ACCESSED)) | ||
24 | fa->fa_state |= FA_S_ACCESSED; | ||
25 | } | ||
26 | |||
20 | /* Exported by fib_semantics.c */ | 27 | /* Exported by fib_semantics.c */ |
21 | extern int fib_semantic_match(struct list_head *head, | 28 | extern int fib_semantic_match(struct list_head *head, |
22 | const struct flowi *flp, | 29 | const struct flowi *flp, |