netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shirley Ma <mashirle@us.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: netdev@vger.kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] defer skb allocation in virtio_net -- mergable buff part
Date: Mon, 24 Aug 2009 10:51:50 -0700	[thread overview]
Message-ID: <1251136310.588.2.camel@localhost.localdomain> (raw)
In-Reply-To: <4A880DFE.2040507@redhat.com>

Hello Avi,

Thanks for you review. I was on vacation last week.

On Sun, 2009-08-16 at 16:47 +0300, Avi Kivity wrote:
> Alternatives include:
> - store the link in the page itself
> - have an array of pages per list element instead of just one pointer
> - combine the two, store an array of page pointers in one of the free
> pages
> - use the struct page::lru member
> 
> The last is the most traditional and easiest so I'd recommend it
> (though 
> it still takes the cacheline hit).

I prefer the combine of the two. But I will compare the performance
differences if no much difference, we can use the easiest one.

> > +static struct page_list *get_a_free_page(struct virtnet_info *vi,
> gfp_t gfp_mask)
> > +{
> > +     struct page_list *plist;
> > +
> > +     if (list_empty(&vi->freed_pages)) {
> > +             plist = kmalloc(sizeof(struct page_list), gfp_mask);
> > +             if (!plist)
> > +                     return NULL;
> > +             list_add_tail(&plist->list,&vi->freed_pages);
> > +             plist->page = alloc_page(gfp_mask);
> >    
> 
> What if the allocation fails here?

It is handled by the caller.

Thanks
Shirley


  reply	other threads:[~2009-08-24 17:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-13  6:33 [RFC] defer skb allocation in virtio_net -- mergable buff part Shirley Ma
2009-08-16 13:47 ` Avi Kivity
2009-08-24 17:51   ` Shirley Ma [this message]
2009-08-25 11:41 ` Michael S. Tsirkin
2009-09-08 18:30   ` Shirley Ma
2009-09-18 17:04   ` Shirley Ma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1251136310.588.2.camel@localhost.localdomain \
    --to=mashirle@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).