[Devel] [PATCH 03/14] net: Port diff-ve-net-af_packet-use-nonpksb

Pavel Emelyanov xemul at parallels.com
Thu Jun 11 05:36:57 PDT 2015


On 06/10/2015 11:54 AM, Konstantin Khorenko wrote:
> Pasha, a question for you:
> 
> long-long ago you've added the ancestor of this patch,
> it was done because "pksbs are not yet accounted properly".
> 
> As you've reworked network accounting recently: are they accounted now?

Yes

> (as far as i see - yes, in kmem)
> 
> Do we still need this trick?

No

> --
> Best regards,
> 
> Konstantin Khorenko,
> Virtuozzo Linux Kernel Team
> 
> On 06/08/2015 05:20 PM, Kirill Tkhai wrote:
>> This patch is from 2.6.32 kernel. It makes packet_alloc_skb()
>> to allocate linear skb (all data is placed in header, and no
>> additional discontinuous pages is used).
>>
>> It's an old commit, and CVS doesn't contain any comments about
>> it. I can suggest, it was used to improve performance on some
>> problems, but it's only suggestion. So I leave it up to Konstantin
>> if he knows why we did that.
>>
>> Signed-off-by: Kirill Tkhai <ktkhai at odin.com>
>> ---
>>  net/packet/af_packet.c |    8 ++------
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
>> index 58688c2..a497efe 100644
>> --- a/net/packet/af_packet.c
>> +++ b/net/packet/af_packet.c
>> @@ -2216,12 +2216,8 @@ static struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad,
>>  {
>>  	struct sk_buff *skb;
>>  
>> -	/* Under a page?  Don't bother with paged skb. */
>> -	if (prepad + len < PAGE_SIZE || !linear)
>> -		linear = len;
>> -
>> -	skb = sock_alloc_send_pskb(sk, prepad + linear, len - linear, noblock,
>> -				   err);
>> +	linear = len;
>> +	skb = sock_alloc_send_skb(sk, prepad + linear, noblock, err);
>>  	if (!skb)
>>  		return NULL;
>>  
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at openvz.org
>> https://lists.openvz.org/mailman/listinfo/devel
>>
> .
> 




More information about the Devel mailing list