From patchwork Wed May 22 00:45:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 245473 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 5BF082C008A for ; Wed, 22 May 2013 10:45:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753458Ab3EVApq (ORCPT ); Tue, 21 May 2013 20:45:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25027 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850Ab3EVApq (ORCPT ); Tue, 21 May 2013 20:45:46 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4M0jiR1007624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 21 May 2013 20:45:44 -0400 Received: from localhost (vpn1-4-206.gru2.redhat.com [10.97.4.206]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4M0jgcm005121; Tue, 21 May 2013 20:45:43 -0400 Date: Tue, 21 May 2013 21:45:41 -0300 From: Flavio Leitner To: netdev@vger.kernel.org Cc: David Miller , Eric Dumazet Subject: RFC limit sk_mem_quantum to 8192 Message-ID: <20130522004541.GA17240@obelix.rh> Mail-Followup-To: netdev@vger.kernel.org, David Miller , Eric Dumazet MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, The page size can be 64k on ppc64, so SK_MEM_QUANTUM increases to that value as well. net/ipv4/tcp.c: ... sysctl_tcp_wmem[0] = SK_MEM_QUANTUM; sysctl_tcp_wmem[1] = 16*1024; sysctl_tcp_wmem[2] = max(64*1024, max_share); sysctl_tcp_rmem[0] = SK_MEM_QUANTUM; sysctl_tcp_rmem[1] = 87380; sysctl_tcp_rmem[2] = max(87380, max_share); and: include/net/sock.h: #define SK_MEM_QUANTUM ((int)PAGE_SIZE) ppc64 config: # CONFIG_PPC_4K_PAGES is not set # CONFIG_PPC_16K_PAGES is not set CONFIG_PPC_64K_PAGES=y # CONFIG_PPC_256K_PAGES is not set It seems too much for a minimum reserved memory. Also, the other values are meaningless in this case because default is only 16k and the maximum is limited to 64k. This will require a modification in the Documentation/networking/ip-sysctl.txt as well which states that default minimum is 1 page. Also, sk_mem_schedule() and friends will have to consider that SK_MEM_QUANTUM might not be PAGE_SIZE anymore. Well, the patch below illustrates what I am talking. thanks, fbl --- 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 diff --git a/include/net/sock.h b/include/net/sock.h index 5d84de4..d52fa2d 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -954,7 +954,12 @@ static inline struct inode *SOCK_INODE(struct socket *socket) extern int __sk_mem_schedule(struct sock *sk, int size, int kind); extern void __sk_mem_reclaim(struct sock *sk); +#if PAGE_SIZE < 8192 #define SK_MEM_QUANTUM ((int)PAGE_SIZE) +#else +#define SK_MEM_QUANTUM ((int)8192) +#endif + #define SK_MEM_QUANTUM_SHIFT ilog2(SK_MEM_QUANTUM) #define SK_MEM_SEND 0 #define SK_MEM_RECV 1