lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1400168465.7973.142.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Thu, 15 May 2014 08:41:05 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Kirill Tkhai <ktkhai@...allels.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	edumazet@...gle.com
Subject: Re: net: unix: Align send data_len up to PAGE_SIZE

On Thu, 2014-05-15 at 18:27 +0400, Kirill Tkhai wrote:
> В Чт, 15/05/2014 в 06:27 -0700, Eric Dumazet пишет:
> > On Thu, 2014-05-15 at 12:54 +0400, Kirill Tkhai wrote:
> > 
> > > 
> > > And I assumed it's OK to allocate skbs with zero header size like this:
> > > 
> > > sock_alloc_send_pskb(sk, 0, data_len)
> > > 
> > > Please say, if it's wrong.
> > > 
> > 
> > Its OK
> > 
> 
> Thanks for the reply. So, new version is below.
> 
> [PATCH]net: unix: Align send data_len up to PAGE_SIZE
>     
> Using whole of allocated pages reduces requested skb->data size.
> This is just a little more thriftily allocation.
>     
> netperf does not show difference with the current performance.
>     
> Signed-off-by: Kirill Tkhai <ktkhai@...allels.com>
> ---
>  net/unix/af_unix.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 749f80c..65d67c2 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -1492,10 +1492,12 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
>  	if (len > sk->sk_sndbuf - 32)
>  		goto out;
>  
> -	if (len > SKB_MAX_ALLOC)
> +	if (len > SKB_MAX_ALLOC) {
>  		data_len = min_t(size_t,
>  				 len - SKB_MAX_ALLOC,
>  				 MAX_SKB_FRAGS * PAGE_SIZE);
> +		data_len = PAGE_ALIGN(data_len);


I would add a BUILD_BUG_ON(SKB_MAX_ALLOC < PAGE_SIZE); just to make sure
nobody ever tries to 

#define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 0))

Also please send a fresh message, do not append a new patch like you
did : http://patchwork.ozlabs.org/patch/349243/

Title should be

[PATCH net-next v3] net: unix: ....



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ