[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN6PR15MB155353F174545B2BB853EF1C9ACA0@BN6PR15MB1553.namprd15.prod.outlook.com>
Date: Sat, 17 Feb 2018 20:13:04 +0000
From: Jon Maloy <jon.maloy@...csson.com>
To: David Miller <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Mohan Krishna Ghanta Krishnamurthy"
<mohan.krishna.ghanta.krishnamurthy@...csson.com>,
"Tung Quang Nguyen" <tung.q.nguyen@...tech.com.au>,
Hoang Huu Le <hoang.h.le@...tech.com.au>,
Canh Duc Luu <canh.d.luu@...tech.com.au>,
"Ying Xue" <ying.xue@...driver.com>,
"tipc-discussion@...ts.sourceforge.net"
<tipc-discussion@...ts.sourceforge.net>
Subject: RE: [net-next v2 1/1] tipc: avoid unnecessary copying of bundled
messages
> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: Friday, February 16, 2018 21:33
> To: Jon Maloy <jon.maloy@...csson.com>
> Cc: netdev@...r.kernel.org; Mohan Krishna Ghanta Krishnamurthy
> <mohan.krishna.ghanta.krishnamurthy@...csson.com>; Tung Quang Nguyen
> <tung.q.nguyen@...tech.com.au>; Hoang Huu Le
> <hoang.h.le@...tech.com.au>; Canh Duc Luu
> <canh.d.luu@...tech.com.au>; Ying Xue <ying.xue@...driver.com>; tipc-
> discussion@...ts.sourceforge.net
> Subject: Re: [net-next v2 1/1] tipc: avoid unnecessary copying of bundled
> messages
>
> From: Jon Maloy <jon.maloy@...csson.com>
> Date: Thu, 15 Feb 2018 14:14:37 +0100
>
> > A received sk buffer may contain dozens of smaller 'bundled' messages
> > which after extraction go each in their own direction.
> >
> > Unfortunately, when we extract those messages using skb_clone() each
> > of the extracted buffers inherit the truesize value of the original
> > buffer. Apart from causing massive overaccounting of the base buffer's
> > memory, this often causes tipc_msg_validate() to come to the false
> > conclusion that the ratio truesize/datasize > 4, and perform an
> > unnecessary copying of the extracted buffer.
> >
> > We now fix this problem by explicitly correcting the truesize value of
> > the buffer clones to be the truesize of the clone itself plus a
> > calculated fraction of the base buffer's overhead. This change
> > eliminates the overaccounting and at least mitigates the occurrence of
> > unnecessary buffer copying.
> >
> > Reported-by: Hoang Le <hoang.h.le@...tek.com.au>
> > Acked-by: Ying Xue <ying.xue@...driver.com>
> > Signed-off-by: Jon Maloy <jon.maloy@...csson.com>
>
> As I explained in my previous two emails, I don't think this method of
> accounting is appropriate.
>
> All of your clones must use the same skb->truesize as the original SKB
> because each and every one of them keeps the full buffer from being
> liberated until they are released.
I understand what you are saying, although I am not happy with its consequences in this case. I guess I will just leave it the way it is until I can come up with something smarter.
///jon
Powered by blists - more mailing lists