All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] memory: add early bail out from cpu_physical_memory_set_dirty_range
@ 2016-01-26 16:59 Paolo Bonzini
  2016-01-28 11:06 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2016-01-26 16:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

This condition is true in the common case, so we can cut out the body of
the function.  In addition, this makes it easier for the compiler to do
at least partial inlining, even if it decides that fully inlining the
function is unreasonable.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/exec/ram_addr.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index ef1489d..6e31fb5 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -161,6 +161,10 @@ static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
     unsigned long end, page;
     unsigned long **d = ram_list.dirty_memory;
 
+    if (!mask && !xen_enabled()) {
+        return;
+    }
+
     end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
     page = start >> TARGET_PAGE_BITS;
     if (likely(mask & (1 << DIRTY_MEMORY_MIGRATION))) {
-- 
2.5.0

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

* Re: [Qemu-devel] [PATCH] memory: add early bail out from cpu_physical_memory_set_dirty_range
  2016-01-26 16:59 [Qemu-devel] [PATCH] memory: add early bail out from cpu_physical_memory_set_dirty_range Paolo Bonzini
@ 2016-01-28 11:06 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2016-01-28 11:06 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, stefanha

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

On Tue, Jan 26, 2016 at 05:59:40PM +0100, Paolo Bonzini wrote:
> This condition is true in the common case, so we can cut out the body of
> the function.  In addition, this makes it easier for the compiler to do
> at least partial inlining, even if it decides that fully inlining the
> function is unreasonable.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  include/exec/ram_addr.h | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2016-01-28 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26 16:59 [Qemu-devel] [PATCH] memory: add early bail out from cpu_physical_memory_set_dirty_range Paolo Bonzini
2016-01-28 11:06 ` Stefan Hajnoczi

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.