aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-31 07:41:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:27:58 -0500
commit76eb946040a7b4c797979a9c22464b9a07890ba5 (patch)
tree34bc4f4bccca7e4fbc7d09ef22f366a9b2a6ce02
parentffaa9c100bd75c81744a2b7800a45daba53db0eb (diff)
[NETFILTER]: nf_conntrack: don't inline early_drop()
early_drop() is only called *very* rarely, unfortunately gcc inlines it into the hotpath because there is only a single caller. Explicitly mark it noinline. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/netfilter/nf_conntrack_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 4a2cce1e1ced..120588333c73 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -420,7 +420,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_tuple_taken);
420 420
421/* There's a small race here where we may free a just-assured 421/* There's a small race here where we may free a just-assured
422 connection. Too bad: we're in trouble anyway. */ 422 connection. Too bad: we're in trouble anyway. */
423static int early_drop(unsigned int hash) 423static noinline int early_drop(unsigned int hash)
424{ 424{
425 /* Use oldest entry, which is roughly LRU */ 425 /* Use oldest entry, which is roughly LRU */
426 struct nf_conntrack_tuple_hash *h; 426 struct nf_conntrack_tuple_hash *h;
@@ -472,8 +472,8 @@ struct nf_conn *nf_conntrack_alloc(const struct nf_conntrack_tuple *orig,
472 /* We don't want any race condition at early drop stage */ 472 /* We don't want any race condition at early drop stage */
473 atomic_inc(&nf_conntrack_count); 473 atomic_inc(&nf_conntrack_count);
474 474
475 if (nf_conntrack_max 475 if (nf_conntrack_max &&
476 && atomic_read(&nf_conntrack_count) > nf_conntrack_max) { 476 unlikely(atomic_read(&nf_conntrack_count) > nf_conntrack_max)) {
477 unsigned int hash = hash_conntrack(orig); 477 unsigned int hash = hash_conntrack(orig);
478 if (!early_drop(hash)) { 478 if (!early_drop(hash)) {
479 atomic_dec(&nf_conntrack_count); 479 atomic_dec(&nf_conntrack_count);