From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH net] virtio-net: fix page refcnt leaking when fail to allocate frag skb Date: Wed, 20 Nov 2013 11:06:27 +0200 Message-ID: <20131120090627.GE19341@redhat.com> References: <1384848307-7217-1-git-send-email-jasowang@redhat.com> <1384869828.8604.97.camel@edumazet-glaptop2.roam.corp.google.com> <20131119204909.GA15004@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Michael Dalton Cc: Eric Dumazet , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lf-virt , Eric Dumazet List-Id: virtualization@lists.linuxfoundation.org On Tue, Nov 19, 2013 at 01:38:16PM -0800, Michael Dalton wrote: > Great catch Jason. I agree this now raises the larger issue of how to > handle a memory alloc failure in the middle of receive. As Eric mentioned, > we can drop the packet and free the remaining (num_buf) frags. > > Michael, perhaps I'm missing something, but why would you prefer > pre-allocating buffers in this case? If the guest kernel is OOM'ing, > dropping packets should provide backpressure. > > Also, we could just as easily fail the initial skb alloc in page_to_skb, > and I think that case also needs to be handled now in the same fashion as > a memory allocation failure in receive_mergeable. > > Best, > > Mike Yes I missed this last night. Thanks a lot Eric and Michael for pointing this out.