From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH net-next 04/11] tuntap: simplify error handling in tun_build_skb() Date: Fri, 7 Sep 2018 10:17:35 -0400 Message-ID: <20180907101645-mutt-send-email-mst@kernel.org> References: <20180906040526.22518-1-jasowang@redhat.com> <20180906040526.22518-5-jasowang@redhat.com> <20180906130425-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: Jason Wang Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Fri, Sep 07, 2018 at 11:22:00AM +0800, Jason Wang wrote: > > > @@ -1668,6 +1668,9 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, > > > if (copied != len) > > > return ERR_PTR(-EFAULT); > > > + get_page(alloc_frag->page); > > > + alloc_frag->offset += buflen; > > > + > > This adds an atomic op on XDP_DROP which is a data path > > operation for some workloads. > > Yes, I have patch on top to amortize this, the idea is to have a very big > refcount once after the frag was allocated and maintain a bias and decrease > them all when allocating new frags.' Why bother with refcounting for a drop though? It should be simple. -- MST