From: Andrew Morton <akpm@osdl.org>
To: Anton Blanchard <anton@samba.org>
Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org,
davem@redhat.com, kenneth.w.chen@intel.com, olof@austin.ibm.com
Subject: Re: [PATCH] performance problem with established hash
Date: Fri, 27 Feb 2004 19:55:48 -0800 [thread overview]
Message-ID: <20040227195548.210f7204.akpm@osdl.org> (raw)
In-Reply-To: <20040228022537.GR5801@krispykreme>
Anton Blanchard <anton@samba.org> wrote:
>
> - goal = min(10UL, goal);
> + goal = min(1UL << 10, goal);
oops. Better fix the route cache too.
I'm not sure what went wrong in there, sorry for letting that slip through.
Obviously, doing
if (a)
foo = bar;
else
foo = zot;
if (b)
foo = rab;
else
foo = toz;
does not make a ton of sense.
This should fix it up. We keep the table sizing identical to that which
we had in 2.6.earlier, with a boot option override.
net/ipv4/route.c | 4 +---
net/ipv4/tcp.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff -puN net/ipv4/route.c~ip_rt_init-sizing-fix net/ipv4/route.c
--- 25/net/ipv4/route.c~ip_rt_init-sizing-fix 2004-02-27 19:43:01.000000000 -0800
+++ 25-akpm/net/ipv4/route.c 2004-02-27 19:51:02.000000000 -0800
@@ -2753,9 +2753,7 @@ int __init ip_rt_init(void)
panic("IP: failed to allocate ip_dst_cache\n");
goal = num_physpages >> (26 - PAGE_SHIFT);
- if (!rhash_entries)
- goal = min(10, goal);
- else
+ if (rhash_entries)
goal = (rhash_entries * sizeof(struct rt_hash_bucket)) >> PAGE_SHIFT;
for (order = 0; (1UL << order) < goal; order++)
/* NOTHING */;
diff -puN net/ipv4/tcp.c~ip_rt_init-sizing-fix net/ipv4/tcp.c
--- 25/net/ipv4/tcp.c~ip_rt_init-sizing-fix 2004-02-27 19:51:40.000000000 -0800
+++ 25-akpm/net/ipv4/tcp.c 2004-02-27 19:52:27.000000000 -0800
@@ -2621,9 +2621,7 @@ void __init tcp_init(void)
else
goal = num_physpages >> (23 - PAGE_SHIFT);
- if (!thash_entries)
- goal = min(10UL, goal);
- else
+ if (thash_entries)
goal = (thash_entries * sizeof(struct tcp_ehash_bucket)) >> PAGE_SHIFT;
for (order = 0; (1UL << order) < goal; order++)
;
_
next prev parent reply other threads:[~2004-02-28 3:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-28 2:25 [PATCH] performance problem with established hash Anton Blanchard
2004-02-28 3:55 ` Andrew Morton [this message]
2004-02-28 7:51 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040227195548.210f7204.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=anton@samba.org \
--cc=davem@redhat.com \
--cc=kenneth.w.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
--cc=olof@austin.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).