From: Olaf Hering <olaf@aepfle.de>
To: Hongkaixing <hongkaixing@huawei.com>
Cc: YangXiaowei <xiaowei.yang@huawei.com>,
"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
"Eric Li(Zhentao)" <lizhentao@huawei.com>,
Yanqiangjun <yanqiangjun@huawei.com>,
hanweidong <hanweidong@huawei.com>
Subject: Re: xenpaing: one way to avoid paging out the page, when the corresponding mfn is in use.
Date: Tue, 1 Nov 2011 18:07:48 +0100 [thread overview]
Message-ID: <20111101170748.GA9034@aepfle.de> (raw)
In-Reply-To: <E0AF011477D2AE458DC8801E0E570709014C0556@szxeml528-mbs.china.huawei.com>
On Tue, Nov 01, Hongkaixing wrote:
> Recently many advanced memory mechanisms are introduced into Xen.
> One problem we found is the conflict between p2m query and setting.
> For example, backend drivers always map domU’s page to its own
> space, during the mapping procedure, situations as follow may
> happen, when mfn is obtained by gfn_to_mfn(), this mfn is likely to
> be paged out.
>
> first case:
> grant mapping xenpaing
> mfn = gfn_to_mfn();
> <----------- p2m_paging_nominate()
> | |
> Check type ok paged out;
> |
> try to map
> What we want is:
> When the page (mfn) is accessed by gfn_to_mfn(), this page should
> never be paged out until the mapping action is end.
The query+map and query+change opterations on p2m entries should be done
under some lock. I have recently updated the p2m_mem_paging* functions
to do their modifications with the p2m_lock held.
Furthermore the change below checks wether something mapped a page
between nominate and evict:
http://xenbits.xen.org/hg/xen-unstable.hg/rev/eda18b27de6e
While this certainly does not fix all possible races, it slightly
reduces the window.
A more complete approach to add locking around p2m modifcations was
recently started by Andres Lagar-Cavilla:
http://lists.xensource.com/archives/html/xen-devel/2011-10/msg01946.html
Olaf
next prev parent reply other threads:[~2011-11-01 17:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-01 12:23 xenpaing: one way to avoid paging out the page, when the corresponding mfn is in use Hongkaixing
2011-11-01 17:07 ` Olaf Hering [this message]
[not found] <20111101124941.583FA72C415@homiemail-mx8.g.dreamhost.com>
2011-11-02 14:44 ` andres
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=20111101170748.GA9034@aepfle.de \
--to=olaf@aepfle.de \
--cc=Xen-devel@lists.xensource.com \
--cc=hanweidong@huawei.com \
--cc=hongkaixing@huawei.com \
--cc=lizhentao@huawei.com \
--cc=xiaowei.yang@huawei.com \
--cc=yanqiangjun@huawei.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.