Message ID | 5908BECC0200007800155EE5@prv-mh.provo.novell.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 02/05/17 16:15, Jan Beulich wrote: > get_page() logs a message when it fails (dom_cow is never dying or > paging_mode_external()), so better avoid the call when it's pointless > to do anyway. > > Signed-off-by: Jan Beulich <jbeulich@suse.com> The other option would be to add "domain == dom_cow" as a condition for which get_page() doesn't report an error. But on the whole I think this is probably the better option: Acked-by: George Dunlap <george.dunlap@citrix.com>
>>> On 02.05.17 at 19:04, <george.dunlap@citrix.com> wrote: > On 02/05/17 16:15, Jan Beulich wrote: >> get_page() logs a message when it fails (dom_cow is never dying or >> paging_mode_external()), so better avoid the call when it's pointless >> to do anyway. >> >> Signed-off-by: Jan Beulich <jbeulich@suse.com> > > The other option would be to add "domain == dom_cow" as a condition for > which get_page() doesn't report an error. That would imo be undesirable namely for the currently one case where get_page(..., dom_cow) is being used from mem_sharing.c. > But on the whole I think this is probably the better option: > > Acked-by: George Dunlap <george.dunlap@citrix.com> Thanks. Jan
--- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -501,9 +501,9 @@ struct page_info *get_page_from_gfn_p2m( if ( fdom == NULL ) page = NULL; } - else if ( !get_page(page, d) + else if ( !get_page(page, d) && /* Page could be shared */ - && !get_page(page, dom_cow) ) + (!p2m_is_shared(*t) || !get_page(page, dom_cow)) ) page = NULL; } p2m_read_unlock(p2m);