[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7df58b0fa274466899a78432eaf19028@AcuMS.aculab.com>
Date: Mon, 19 Feb 2018 13:29:56 +0000
From: David Laight <David.Laight@...LAB.COM>
To: "jon.maloy@...csson.com" <jon.maloy@...csson.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"mohan.krishna.ghanta.krishnamurthy@...csson.com"
<mohan.krishna.ghanta.krishnamurthy@...csson.com>,
"tung.q.nguyen@...tech.com.au" <tung.q.nguyen@...tech.com.au>,
"hoang.h.le@...tech.com.au" <hoang.h.le@...tech.com.au>,
"canh.d.luu@...tech.com.au" <canh.d.luu@...tech.com.au>,
"ying.xue@...driver.com" <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
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.
Have you actually checked that copying the data when you extract the
messages isn't faster than cloning and trying to avoid the copy?
Copying at the point is probably cheaper because it leads to
a simpler message structure.
David
Powered by blists - more mailing lists