From: David Vrabel <david.vrabel@citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: dcrisan@flexiant.com, xen-devel@lists.xensource.com,
alex@alex.org.uk,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v2 1/2] xen/balloon: set a mapping for ballooned out pages
Date: Tue, 23 Jul 2013 16:03:49 +0100 [thread overview]
Message-ID: <51EE9B55.5040303@citrix.com> (raw)
In-Reply-To: <1374589626.6623.114.camel@hastur.hellion.org.uk>
On 23/07/13 15:27, Ian Campbell wrote:
> On Tue, 2013-07-23 at 10:58 +0100, David Vrabel wrote:
>> On 22/07/13 18:32, Ian Campbell wrote:
>>> On Mon, 2013-07-22 at 18:26 +0100, David Vrabel wrote:
>>>> On 22/07/13 18:22, Ian Campbell wrote:
>>>>> On Mon, 2013-07-22 at 17:51 +0100, David Vrabel wrote:
>>>>>> On 22/07/13 17:28, Stefano Stabellini wrote:
>>>>>>>
>>>>>>> #ifdef CONFIG_HIGHMEM
>>>>>>> #define inc_totalhigh_pages() (totalhigh_pages++)
>>>>>>> @@ -423,7 +426,8 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
>>>>>>> if (xen_pv_domain() && !PageHighMem(page)) {
>>>>>>> ret = HYPERVISOR_update_va_mapping(
>>>>>>> (unsigned long)__va(pfn << PAGE_SHIFT),
>>>>>>> - __pte_ma(0), 0);
>>>>>>> + pfn_pte(page_to_pfn(get_balloon_trade_page()),
>>>>>>> + PAGE_KERNEL_RO), 0);
>>>>>>
>>>>>> Preemption needs to be disabled while using the trade page, see
>>>>>> suggestion below.
>>>>>
>>>>> Hopefully you mean just when setting up/manipulating it?
>>>>
>>>> Yes, sorry.
>>>>
>>>> get_...()
>>>> update_va_mapping()
>>>> put_...()
>>>
>>> I can see why it would matter in the unmap_and_replace+fixup case (since
>>> you need them to happen "atomically") but why in this case? We don't
>>> actually care which of the trade pages gets used for this purpose, so
>>> even if we happen to get preempted and change CPU it doesn't really
>>> matter.
>>
>> If a trade page from another CPU is used, it may concurrently have it's
>> MFN cleared by a unmap_and_replace call on the other CPU.
>
> The call on the other CPU clears the virtual address, not the MFN, so
> long as we have the MFN in our hand we are OK, I think? Nothing updates
> the m2p or p2m does it?
Yes, I think you're correct here.
But, does this need to be mfn_pte(page_to_mfn(get_balloon_trade_page())?
The pte parameter to update_va_mapping() needs to contains the machine
address, right?
David
next prev parent reply other threads:[~2013-07-23 15:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 16:21 [PATCH v2 0/2] make ballooned out pages have a valid mapping at all times Stefano Stabellini
2013-07-22 16:28 ` [PATCH v2 1/2] xen/balloon: set a mapping for ballooned out pages Stefano Stabellini
2013-07-22 16:51 ` David Vrabel
2013-07-22 17:22 ` Ian Campbell
2013-07-22 17:26 ` David Vrabel
2013-07-22 17:32 ` Ian Campbell
2013-07-23 9:58 ` David Vrabel
2013-07-23 14:27 ` Ian Campbell
2013-07-23 15:03 ` David Vrabel [this message]
2013-07-23 17:04 ` Ian Campbell
2013-07-23 17:20 ` Stefano Stabellini
2013-07-23 17:33 ` David Vrabel
2013-07-23 12:49 ` Stefano Stabellini
2013-07-23 14:24 ` Ian Campbell
2013-07-23 13:58 ` Konrad Rzeszutek Wilk
2013-07-22 16:28 ` [PATCH v2 2/2] xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping Stefano Stabellini
2013-07-22 17:02 ` David Vrabel
2013-07-23 10:35 ` Roger Pau Monné
2013-07-23 12:37 ` Stefano Stabellini
2013-07-23 12:47 ` Stefano Stabellini
2013-07-23 13:57 ` Konrad Rzeszutek Wilk
2013-07-23 14:23 ` Ian Campbell
2013-07-23 14:48 ` Alex Bligh
2013-07-23 14:51 ` Ian Campbell
2013-07-23 15:06 ` Alex Bligh
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=51EE9B55.5040303@citrix.com \
--to=david.vrabel@citrix.com \
--cc=alex@alex.org.uk \
--cc=dcrisan@flexiant.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--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 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.