Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Flavio Leitner <fbl@redhat.com>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>
Subject: Re: RFC limit sk_mem_quantum to 8192
Date: Tue, 21 May 2013 18:09:22 -0700	[thread overview]
Message-ID: <1369184962.3301.264.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130522004541.GA17240@obelix.rh>

On Tue, 2013-05-21 at 21:45 -0300, Flavio Leitner wrote:
> 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
> 
> 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
> 

What particular problem do you want to solve ?

Wouldn't be easier to chose 4096 on all arches ?

Are you sure a network driver doesn't provide skb using a full page ?

  reply	other threads:[~2013-05-22  1:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  0:45 RFC limit sk_mem_quantum to 8192 Flavio Leitner
2013-05-22  1:09 ` Eric Dumazet [this message]
2013-05-22  1:58   ` Flavio Leitner
2013-05-22  2:21     ` Eric Dumazet
2013-05-22 14:31       ` Flavio Leitner

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=1369184962.3301.264.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=fbl@redhat.com \
    --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