|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/mm: Avoid assuming PG_state_inuse == 0 in assign_pages()
Hi Jan, On 05/02/2020 13:36, Jan Beulich wrote: On 05.02.2020 12:24, Julien Grall wrote:Hi Jan, On 04/02/2020 15:13, Jan Beulich wrote:On 04.02.2020 14:51, Julien Grall wrote:On 04/02/2020 13:40, Jan Beulich wrote:On 04.02.2020 14:33, Julien Grall wrote:At the moment, assign_pages() relies on PG_state_inuse to be 0. This makes the code slightly more difficult to understand.I can certainly see where you're coming from, but ... There will be a slight difference for the offline code. After assign_pages() we would return PG_OFFLINE_OWNED... while in the middle of assign_pages() we would return PG_OFFLINE_ANYMOUS. I was concern of the interaction. But it looks like this was taken care per the comment in offline_pages (though the comment is slightly confusing). Anyway, try to revert the change would be real pain. So we can avoid it then it is much better :). All we need to make sure is that we don't clobber the state change. I'm also not sure a cmpxchg loop is needed here. Acquiring and releasing the heap lock may do, too. You'll find an example of this elsewhere in the same file, iirc. I would have thought the cmpxchg() would be your preference. Anyway, if you are happy with the lock, then this is better and less code. The locking ordering would also be fine as domain_adjust_tot_pages() already request the d->page_alloc_lock to be taken first. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |