From: Avi Kivity <avi@qumranet.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Shaohua Li <shaohua.li@intel.com>,
kvm-devel <kvm-devel@lists.sourceforge.net>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [kvm-devel] [RFC 0/8]KVM: swap out guest pages
Date: Tue, 24 Jul 2007 09:59:58 +0300 [thread overview]
Message-ID: <46A5A36E.8000409@qumranet.com> (raw)
In-Reply-To: <1185259509.1803.237.camel@localhost.localdomain>
Rusty Russell wrote:
>
>>> If not, it does get harder. A callback in the mm struct to say "I want
>>> to swap your page out" is required if we don't take a reference to the
>>> page. Dirty bit handling would be an interesting issue (maybe the
>>> callback can say "No!" and dirty the page again?).
>>>
>> Since we have rmap, I don't see that as an issue. Given a page, we can
>> easily drop all refs. Though lguest doesn't do that, right?
>>
>
> Yeah, rmap might maul some puppies. I could do poor man's rmap tho with
> one backref and a bit to say "there are more". Then if that bit is set,
> I just drop all 4 shadows 8)
>
>
It's too poor. A long running guest will eventually map all of memory
using the kernel page tables and a large proportion with user page
tables, so many pages will have that bit set.
However, you can probably work around that by not setting an rmap for
the kernel mappings, and instead have the guest teach the host where the
kernel page tables live. You'd only be left with shared libraries,
until the kernel can share page tables for them too.
>> I'm also concerned with picking the correct page, but there's no good
>> solution here.
>>
>
> But since you have rmap, if there was a cb when the the page was
> undirtied, you could undirty the ptes. When there "I want to kick this
> page out" cb comes along, see if one of the ptes is now dirty, dirty the
> page and return "no".
>
> Maybe it's too simplistic, but it might work.
>
Ah, I see what you mean now. It could work, as far as I can tell (which
isn't very far, though).
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2007-07-24 7:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 6:51 [RFC 0/8]KVM: swap out guest pages Shaohua Li
2007-07-23 10:27 ` Avi Kivity
2007-07-23 12:25 ` [kvm-devel] " Christoph Hellwig
2007-07-23 12:29 ` Avi Kivity
2007-07-23 12:34 ` Christoph Hellwig
2007-07-23 12:39 ` Avi Kivity
2007-07-24 2:00 ` Shaohua Li
2007-07-23 20:06 ` Jeff Dike
2007-07-24 5:22 ` Avi Kivity
2007-07-25 16:15 ` Jeff Dike
2007-07-25 17:12 ` [kvm-devel] " Carsten Otte
2007-07-23 23:10 ` Rusty Russell
2007-07-24 5:30 ` Avi Kivity
2007-07-24 6:11 ` Rusty Russell
2007-07-24 6:21 ` Avi Kivity
2007-07-24 6:45 ` Rusty Russell
2007-07-24 6:59 ` Avi Kivity [this message]
2007-07-24 7:17 ` Rusty Russell
2007-07-24 1:42 ` Shaohua Li
2007-07-24 5:42 ` Avi Kivity
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=46A5A36E.8000409@qumranet.com \
--to=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=shaohua.li@intel.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