[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 3/3] xen: use idle vcpus to scrub pages

>>> On 15.07.14 at 11:16, <bob.liu@xxxxxxxxxx> wrote:
> After so many days I haven't make a workable solution if don't remove
> pages temporarily. The hardest part is iterating the heap free list
> without holding heap_lock because if holding the lock it might be heavy
> lock contention.
> So do you think it's acceptable if fixed all other concerns about this
> patch?

No, I don't think so. Instead I'm of the opinion that you may have
worked in the wrong direction: Rather than not taking the heap lock
at all, it may also be sufficient to shrink the lock holding time (i.e.
avoid long loops with the lock held).

> And there is another idea based on the assumption that only guest
> allocation need all pages to be scrubbed(It's safe for xen hypervisor to
> use an un-scrubbed page):
> 1. set the need_scrub flag in free_heap_pages().
> 2. alloc pages from heap free list, don't scrub and neither clear the
> need_scrub flag.
> 3. When the guest accessing the real memory(machine pages) the first
> time, page fault should happen. We track this event and before build the
> right PFN to MFN page table mappings(correct me if it doesn't work as
> this), at this place scrub the page if the need_scrub flag was set.
> By this way only guest real used pages are needed scrubbing and the time
> is scattered.
> How do you think of this solution?

If you can get this to work cleanly for all guest types, that would
certainly be an option.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.