netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] use total_highpages when calculating lowmem-only allocation sizes (dccp)
@ 2010-12-06 16:42 Jan Beulich
  2010-12-06 17:36 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2010-12-06 16:42 UTC (permalink / raw)
  To: netdev; +Cc: akpm

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 *




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-12-08  0:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-06 16:42 [PATCH] use total_highpages when calculating lowmem-only allocation sizes (dccp) Jan Beulich
2010-12-06 17:36 ` David Miller
2010-12-07 14:38   ` Jan Beulich
2010-12-08  0:49     ` David Miller

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).