All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/mm: silence a pointless warning
@ 2017-05-02 15:15 Jan Beulich
  2017-05-02 15:31 ` Jan Beulich
  2017-05-02 17:04 ` George Dunlap
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Beulich @ 2017-05-02 15:15 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Andrew Cooper, Julien Grall

[-- Attachment #1: Type: text/plain, Size: 851 bytes --]

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>
---
Possibly we could be even more rigid and bail right away if ->is_dying
is set.

--- 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);




[-- Attachment #2: x86-mm-silence-warning.patch --]
[-- Type: text/plain, Size: 884 bytes --]

x86/mm: silence a pointless warning

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>
---
Possibly we could be even more rigid and bail right away if ->is_dying
is set.

--- 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);

[-- Attachment #3: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-03  7:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02 15:15 [PATCH] x86/mm: silence a pointless warning Jan Beulich
2017-05-02 15:31 ` Jan Beulich
2017-05-02 16:54   ` George Dunlap
2017-05-03  7:25     ` Jan Beulich
2017-05-02 17:04 ` George Dunlap
2017-05-03  7:31   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.