From: David Vrabel <david.vrabel@citrix.com>
To: Zoltan Kiss <zoltan.kiss@citrix.com>
Cc: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
"David Vrabel" <david.vrabel@citrix.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, xen-devel@lists.xenproject.org,
linux-kernel@vger.kernel.org,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Ian Campbell" <Ian.Campbell@citrix.com>,
stefano.stabellini@eu.citrix.com
Subject: Re: [Xen-devel] [PATCH v8] xen/grant-table: Avoid m2p_override during mapping
Date: Fri, 7 Feb 2014 18:42:16 +0000 [thread overview]
Message-ID: <52F52908.4080205@citrix.com> (raw)
In-Reply-To: <1391691376-21471-1-git-send-email-zoltan.kiss@citrix.com>
On 06/02/14 12:56, Zoltan Kiss wrote:
> The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
> for blkback and future netback patches it just cause a lock contention, as
> those pages never go to userspace. Therefore this series does the following:
> - the original functions were renamed to __gnttab_[un]map_refs, with a new
> parameter m2p_override
> - based on m2p_override either they follow the original behaviour, or just set
> the private flag and call set_phys_to_machine
> - gnttab_[un]map_refs are now a wrapper to call __gnttab_[un]map_refs with
> m2p_override false
> - a new function gnttab_[un]map_refs_userspace provides the old behaviour
> - it cuts out common parts from m2p_*_override functions to
> *_foreign_p2m_mapping functions
>
> It also removes a stray space from page.h and change ret to 0 if
> XENFEAT_auto_translated_physmap, as that is the only possible return value
> there.
>
> v2:
Please put this version information after the '---' marker. It doesn't
need to end up in the commit message.
> @@ -955,10 +957,12 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
> set_phys_to_machine(map_ops[i].host_addr >> PAGE_SHIFT,
> map_ops[i].dev_bus_addr >> PAGE_SHIFT);
> }
> - return ret;
> + return 0;
> }
>
> - if (!in_interrupt() && paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> + if (m2p_override &&
> + !in_interrupt() &&
> + paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> arch_enter_lazy_mmu_mode();
> lazy = true;
> }
I think this block and the loop should be in an arch-specific function
(e.g., set_foreign_p2m_mappings(), but I would like to hear Stefano's
opinion.
Similarly for clear_foreign_p2m_mappings().
David
next prev parent reply other threads:[~2014-02-07 18:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 12:56 [PATCH v8] xen/grant-table: Avoid m2p_override during mapping Zoltan Kiss
2014-02-07 18:42 ` David Vrabel [this message]
2014-02-11 18:55 ` Stefano Stabellini
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=52F52908.4080205@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=hpa@zytor.com \
--cc=jbeulich@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=roger.pau@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=zoltan.kiss@citrix.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).