|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] arm/p2m: Fix regression during domain shutdown with active mem_access
On 24/01/2017 22:45, Tamas K Lengyel wrote: On Tue, Jan 24, 2017 at 3:32 PM, Julien Grall <julien.grall@xxxxxxx> wrote:On 24/01/2017 22:19, Tamas K Lengyel wrote:On Tue, Jan 24, 2017 at 3:13 PM, Julien Grall <julien.grall@xxxxxxx> wrote:Hi Tamas, On 24/01/2017 22:10, Tamas K Lengyel wrote: How did you deduce this number? It is a valid use case to protect all the RAM, and it is what xen-memaccess is doing by default. So if your guest has 3GB of RAM you would have ~800000 entries. So instead of checking all possible gfns if they are present in the tree and then removing them, just to be followed by destroying the tree, we can just destroy the tree once and be done with it. Since the most expensive operation with the tree are adding and removing nodes, IMHO we should skip that if possible. If you look at the code, p2m_get_entry is taking a NULL pointer for the access so the code will not retrieve the memaccess permission. The only operation memaccess related done by p2m_relinquish will be removing an element from the tree. You seem to only have in mind that destroying a domain will be faster with this patch. You are right that it will be faster, however you also need to have in mind the impact on Xen and the rest of the platform. Any processor running Xen code is not be preemptible unless asked by the code itself. This means that we need to break down expensive task to avoid "locking" a processor for too long. The function radix_tree_destroy could be very expensive to run as you have to browse the tree to free the associated memory. A couple of entry would be fast, now imagine 800000 entries (and even more on guest with large amount of memory). So yes, I prefer to have a domain to be destroyed more "slowly" but at least there will be less impact on others. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |