From: "Jan Beulich" <JBeulich@novell.com>
To: <netdev@vger.kernel.org>
Cc: <akpm@linux-foundation.org>
Subject: [PATCH] use total_highpages when calculating lowmem-only allocation sizes (dccp)
Date: Mon, 06 Dec 2010 16:42:46 +0000 [thread overview]
Message-ID: <4CFD2096020000780002627B@vpn.id2.novell.com> (raw)
For those (large) table allocations that come only from lowmem, the
total amount of memory shouldn't really matter.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
net/dccp/proto.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- linux-2.6.37-rc4/net/dccp/proto.c
+++ 2.6.37-rc4-use-totalhigh_pages/net/dccp/proto.c
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/kernel.h>
+#include <linux/highmem.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/in.h>
@@ -1068,10 +1069,11 @@ static int __init dccp_init(void)
*
* The methodology is similar to that of the buffer cache.
*/
- if (totalram_pages >= (128 * 1024))
- goal = totalram_pages >> (21 - PAGE_SHIFT);
+ goal = totalram_pages - totalhigh_pages;
+ if (goal >= (128 * 1024))
+ goal >>= 21 - PAGE_SHIFT;
else
- goal = totalram_pages >> (23 - PAGE_SHIFT);
+ goal >>= 23 - PAGE_SHIFT;
if (thash_entries)
goal = (thash_entries *
next reply other threads:[~2010-12-06 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-06 16:42 Jan Beulich [this message]
2010-12-06 17:36 ` [PATCH] use total_highpages when calculating lowmem-only allocation sizes (dccp) David Miller
2010-12-07 14:38 ` Jan Beulich
2010-12-08 0:49 ` David 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=4CFD2096020000780002627B@vpn.id2.novell.com \
--to=jbeulich@novell.com \
--cc=akpm@linux-foundation.org \
--cc=netdev@vger.kernel.org \
/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).