From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH][net-next] netlink: avoid to allocate full skb when sending to many devices Date: Tue, 18 Sep 2018 07:08:04 -0700 Message-ID: <3f01dd84-32c5-f674-75ac-a93a90f32bf7@gmail.com> References: <1537248415-15534-1-git-send-email-lirongqing@baidu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Li RongQing , netdev@vger.kernel.org Return-path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:35203 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728403AbeIRTkw (ORCPT ); Tue, 18 Sep 2018 15:40:52 -0400 Received: by mail-pl1-f195.google.com with SMTP id g2-v6so1074450plo.2 for ; Tue, 18 Sep 2018 07:08:06 -0700 (PDT) In-Reply-To: <1537248415-15534-1-git-send-email-lirongqing@baidu.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 09/17/2018 10:26 PM, Li RongQing wrote: > if skb->head is vmalloc address, when this skb is delivered, full > allocation for this skb is required, if there are many devices, > the full allocation will be called for every devices > > now using the first time allocated skb when iterate other devices > to send, reduce full allocation and speedup deliver. > > Signed-off-by: Zhang Yu > Signed-off-by: Li RongQing > --- > net/netlink/af_netlink.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > This looks very broken to me. Only the original skb (given as an argument to __netlink_deliver_tap()) is guaranteed to not disappear while the loop is performed. (There is no skb_clone() after the first netlink_to_full_skb())