xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: ANNIE LI <annie.li@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/netback: implements persistent grant with one page pool.
Date: Fri, 16 Nov 2012 17:55:41 +0800	[thread overview]
Message-ID: <50A60D9D.80601@oracle.com> (raw)
In-Reply-To: <1353058074.3499.166.camel@zakaz.uk.xensource.com>



On 2012-11-16 17:27, Ian Campbell wrote:
> On Fri, 2012-11-16 at 02:18 +0000, ANNIE LI wrote:
>> In this patch,
>> The maximum of memory overhead is about
>>
>> (XEN_NETIF_TX_RING_SIZE+XEN_NETIF_RX_RING_SIZE)*PAGE_SIZE  (plus size of grant_ref_t and handle)
>> which is about 512 PAGE_SIZE. Normally, without heavy network offload, this maximum can not be reached.
>>
>> In next patch of splitting tx/rx pool, the maximum is about
> "about" or just "is"?

For only grant pages, it is this value. I took into account other 
element of grant_ref_t and map(change to handle in future)....

>
>>   (256+512)PAGE_SIZE.
> IOW 3MB.
>
>>>> +
>>>> +       return NULL;
>>>> +}
>>>> +
>>>> @@ -1338,7 +1497,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>>>>                   gop->source.domid = vif->domid;
>>>>                   gop->source.offset = txreq.offset;
>>>>
>>>> -               gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>>> +               if (!vif->persistent_grant)
>>>> +                       gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>>> +               else
>>>> +                       gop->dest.u.gmfn = (unsigned long)page_address(page);
>>> page_address doesn't return any sort of frame number, does it? This is
>>> rather confusing...
>> Yes. I only use dest.u.gmfn element to save the page_address here for
>> future memcpy, and it does not mean to use frame number actually. To
>> avoid confusion, here I can use
>>
>> gop->dest.u.gmfn = virt_to_mfn(page_address(page));
>>
>> and then call mfn_to_virt when doing memcpy.
> It seems a bit odd to be using the gop structure in this way when you
> aren't actually doing a grant op on it.
>
> While investigating I noticed:
> +static int
> +grant_memory_copy_op(unsigned int cmd, void *vuop, unsigned int count,
> +                    struct xen_netbk *netbk, bool tx_pool)
> ...
> +       struct gnttab_copy *uop = vuop;
>
> Why void *vuop? Why not struct gnttab_copy * in the parameter?

Sorry, my mistake.

>
> I also noticed your new grant_memory_copy_op() seems to have unbatched
> the grant ops in the non-persistent case, which is going to suck for
> performance in non-persistent mode. You need to pull the conditional and
> the HYPERVISOR_grant_table_op outside the loop and pass it full array
> instead of doing them one at a time.

This still connects with netback per-VIF implementation.
Currently, these could not be pulled out outside since netback queue may 
contains persistent and nonpersistent in the same queue. I did consider 
to implement per-VIF first and then the persistent grant,
but thinking of it is part of wei's patch combined with other patches, 
and finally decided to implement per-VIF later.

But this does limit implementation of persistent grant.

Thanks
Annie
>
> Ian
>

  reply	other threads:[~2012-11-16  9:55 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15  7:03 [PATCH 0/4] Implement persistent grant in xen-netfront/netback Annie Li
2012-11-15  7:04 ` [PATCH 1/4] xen/netback: implements persistent grant with one page pool Annie Li
2012-11-15  9:10   ` Ian Campbell
2012-11-16  2:18     ` [Xen-devel] " ANNIE LI
2012-11-16  9:27       ` Ian Campbell
2012-11-16  9:55         ` ANNIE LI [this message]
2012-11-15  9:57   ` Roger Pau Monné
2012-11-16  2:49     ` ANNIE LI
2012-11-16  7:57       ` ANNIE LI
2012-11-16  9:32       ` Ian Campbell
2012-11-16 11:34         ` ANNIE LI
2012-11-15  7:04 ` [PATCH 2/4] xen/netback: Split one page pool into two(tx/rx) " Annie Li
2012-11-15  9:15   ` Ian Campbell
2012-11-16  3:10     ` ANNIE LI
2012-11-15  7:05 ` [PATCH 3/4] Xen/netfront: Implement persistent grant in netfront Annie Li
2012-11-15 10:52   ` [Xen-devel] " Roger Pau Monné
2012-11-16  5:22     ` ANNIE LI
2012-11-16  7:58       ` ANNIE LI
2012-11-15  7:05 ` [PATCH 4/4] fix code indent issue in xen-netfront Annie Li
2012-11-15  7:40 ` [PATCH 0/4] Implement persistent grant in xen-netfront/netback Pasi Kärkkäinen
2012-11-15  8:38   ` [Xen-devel] " ANNIE LI
2012-11-15  8:51     ` Ian Campbell
2012-11-15  9:02       ` ANNIE LI
2012-11-15  9:35     ` Wei Liu
2012-11-15 11:12       ` [Xen-devel] " ANNIE LI
2012-11-16 15:34       ` Konrad Rzeszutek Wilk
2012-11-15 10:56     ` Roger Pau Monné
2012-11-15 11:14       ` ANNIE LI
2012-11-15 11:15       ` Ian Campbell
2012-11-15 18:29         ` Konrad Rzeszutek Wilk
2012-11-15 19:11           ` Ian Campbell
2012-11-16 15:23             ` Konrad Rzeszutek Wilk
2012-11-16 15:21       ` Konrad Rzeszutek Wilk
2012-11-15  8:53 ` Ian Campbell
2012-11-15 11:14   ` ANNIE LI
2012-11-15  8:56 ` Ian Campbell
2012-11-15 11:14   ` [Xen-devel] " ANNIE LI
2012-11-16  9:57 ` Ian Campbell
2012-11-16 11:37   ` ANNIE LI
2012-11-16 11:46     ` Ian Campbell
2012-11-17  4:39       ` annie li
2012-11-16 15:18 ` Konrad Rzeszutek Wilk

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=50A60D9D.80601@oracle.com \
    --to=annie.li@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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).