> -----Original Message----- > From: David Laight [mailto:[email protected]] > Sent: Monday, February 19, 2018 14:30 > To: Jon Maloy <[email protected]> > Cc: [email protected]; Mohan Krishna Ghanta Krishnamurthy > <[email protected]>; Tung Quang Nguyen > <[email protected]>; Hoang Huu Le > <[email protected]>; Canh Duc Luu > <[email protected]>; Ying Xue <[email protected]>; tipc- > [email protected] > Subject: RE: [net-next v2 1/1] tipc: avoid unnecessary copying of bundled > messages > > From: Jon Maloy <[email protected]> > 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.
Yes, that is probably what I'll end up doing, if copying is unavoidable anyway. ///jon > > David ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ tipc-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tipc-discussion
