From patchwork Mon Dec 6 16:42:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 74390 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B2756B6F1E for ; Tue, 7 Dec 2010 03:42:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752893Ab0LFQmv (ORCPT ); Mon, 6 Dec 2010 11:42:51 -0500 Received: from vpn.id2.novell.com ([195.33.99.129]:48352 "EHLO vpn.id2.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560Ab0LFQmv convert rfc822-to-8bit (ORCPT ); Mon, 6 Dec 2010 11:42:51 -0500 Received: from EMEA1-MTA by vpn.id2.novell.com with Novell_GroupWise; Mon, 06 Dec 2010 17:13:12 +0000 Message-Id: <4CFD2096020000780002627B@vpn.id2.novell.com> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 06 Dec 2010 16:42:46 +0000 From: "Jan Beulich" To: Cc: Subject: [PATCH] use total_highpages when calculating lowmem-only allocation sizes (dccp) Mime-Version: 1.0 Content-Disposition: inline Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For those (large) table allocations that come only from lowmem, the total amount of memory shouldn't really matter. Signed-off-by: Jan Beulich --- net/dccp/proto.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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 #include #include +#include #include #include #include @@ -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 *