Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158991
b: refs/heads/master
c: be916cd
h: refs/heads/master
i:
  158989: 4d7ed5b
  158987: 09b199c
  158983: 1bd086b
  158975: 2166ca2
v: v3
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Jul 20, 2009
1 parent a172342 commit 38ba9af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3059477fce2d956a0bb3e04357324780c5d8eeb
refs/heads/master: be916cdebe4dc720a23b1a9bb589f2c22afd6589
29 changes: 22 additions & 7 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ static const int inflate_threshold = 50;
static const int halve_threshold_root = 15;
static const int inflate_threshold_root = 25;

static int inflate_threshold_root_fix;
#define INFLATE_FIX_MAX 10 /* a comment in resize() */

static void __alias_free_mem(struct rcu_head *head)
{
Expand Down Expand Up @@ -617,7 +619,8 @@ static struct node *resize(struct trie *t, struct tnode *tn)
/* Keep root node larger */

if (!tn->parent)
inflate_threshold_use = inflate_threshold_root;
inflate_threshold_use = inflate_threshold_root +
inflate_threshold_root_fix;
else
inflate_threshold_use = inflate_threshold;

Expand All @@ -641,15 +644,27 @@ static struct node *resize(struct trie *t, struct tnode *tn)
}

if (max_resize < 0) {
if (!tn->parent)
pr_warning("Fix inflate_threshold_root."
" Now=%d size=%d bits\n",
inflate_threshold_root, tn->bits);
else
if (!tn->parent) {
/*
* It was observed that during large updates even
* inflate_threshold_root = 35 might be needed to avoid
* this warning; but it should be temporary, so let's
* try to handle this automatically.
*/
if (inflate_threshold_root_fix < INFLATE_FIX_MAX)
inflate_threshold_root_fix++;
else
pr_warning("Fix inflate_threshold_root."
" Now=%d size=%d bits fix=%d\n",
inflate_threshold_root, tn->bits,
inflate_threshold_root_fix);
} else {
pr_warning("Fix inflate_threshold."
" Now=%d size=%d bits\n",
inflate_threshold, tn->bits);
}
}
} else if (max_resize > 3 && !tn->parent && inflate_threshold_root_fix)
inflate_threshold_root_fix--;

check_tnode(tn);

Expand Down

0 comments on commit 38ba9af

Please sign in to comment.