All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org, Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>, Tim Deegan <tim@xen.org>
Subject: Re: [PATCH 3/3] grant-table: defer releasing pages acquired in a grant copy
Date: Thu, 22 Jan 2015 16:01:36 +0000	[thread overview]
Message-ID: <54C12CF00200007800058581@mail.emea.novell.com> (raw)
In-Reply-To: <54C10BB4.90109@citrix.com>

>>> On 22.01.15 at 15:39, <david.vrabel@citrix.com> wrote:
> On 22/01/15 14:34, Jan Beulich wrote:
>>>>> On 20.01.15 at 19:19, <david.vrabel@citrix.com> wrote:
>>> Acquiring a page for the source or destination of a grant copy is an
>>> expensive operation.  A common use case is for two adjacent grant copy
>>> ops to operate on either the same source or the same destination page.
>>>
>>> Instead of always acquiring and releasing destination and source pages
>>> for each operation, release the page once it is no longer valid for
>>> the next op.
>>>
>>> If either the source or destination domains changes both pages are
>>> released as it is unlikely that either will still be valid.
>>>
>>> XenServer's performance benchmarks show modest improvements in network
>>> receive throughput (netback uses grant copy in the guest Rx path) and
>>> no regressions in disk performamnce (using tapdisk3 which grant copies
>>> as the backend).
> [...]
>>> +static bool_t gnttab_copy_buf_valid(const struct gnttab_copy *op,
>>> +                                    const struct gnttab_copy_ptr *p,
>>> +                                    const struct gnttab_copy_buf *b,
>>> +                                    unsigned int gref_flag)
>>> +{
>>> +    if ( !b->virt )
>>> +        return 0;
>>> +    if ( op->flags & gref_flag )
>>> +        return b->have_grant && p->u.ref == b->ptr.u.ref;
>>> +    return p->u.gmfn == b->ptr.u.gmfn;
>>> +}
>> 
>> ... whether you wouldn't better fold the op and gref_flag parameters
>> into one, as they're used only once and only together.
> 
> Do you mean something like?
> 
> static bool_t gnttab_copy_buf_valid(const struct gnttab_copy_ptr *p,
>                                    const struct gnttab_copy_buf *b,
>                                    bool_t is_gref)

Yes.

Jan

  reply	other threads:[~2015-01-22 16:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 18:19 [PATCHv2 0/3] grant-table: optimize grant copies when crossing page boundaries David Vrabel
2015-01-20 18:19 ` [PATCH 1/3] grant-table: use uint16_t consistently for grant copy offset and length David Vrabel
2015-01-22 14:24   ` Jan Beulich
2015-01-20 18:19 ` [PATCH 2/3] grant-table: refactor grant copy to reduce duplicate code David Vrabel
2015-01-22 14:24   ` Jan Beulich
2015-01-22 14:42     ` David Vrabel
2015-01-22 16:04       ` Jan Beulich
2015-01-22 16:28   ` Tim Deegan
2015-01-20 18:19 ` [PATCH 3/3] grant-table: defer releasing pages acquired in a grant copy David Vrabel
2015-01-22 14:34   ` Jan Beulich
2015-01-22 14:39     ` David Vrabel
2015-01-22 16:01       ` Jan Beulich [this message]
2015-01-22 16:33   ` Tim Deegan
2015-01-23 10:43 [PATCHv3 0/3] grant-table: optimize grant copies when crossing page boundaries David Vrabel
2015-01-23 10:43 ` [PATCH 3/3] grant-table: defer releasing pages acquired in a grant copy David Vrabel

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=54C12CF00200007800058581@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=david.vrabel@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.