diff mbox series

[v3,3/4] x86/mem_sharing: enable mem_share audit mode only in debug builds

Message ID 20190426172138.14669-3-tamas@tklengyel.com (mailing list archive)
State Superseded
Headers show
Series [v3,1/4] x86/mem_sharing: reorder when pages are unlocked and released | expand

Commit Message

Tamas K Lengyel April 26, 2019, 5:21 p.m. UTC
Improves performance for release builds.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>
---
 xen/include/asm-x86/mem_sharing.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Beulich April 29, 2019, 2:57 p.m. UTC | #1
>>> On 26.04.19 at 19:21, <tamas@tklengyel.com> wrote:
> --- a/xen/include/asm-x86/mem_sharing.h
> +++ b/xen/include/asm-x86/mem_sharing.h
> @@ -25,7 +25,9 @@
>  #include <public/memory.h>
>  
>  /* Auditing of memory sharing code? */
> +#ifndef NDEBUG
>  #define MEM_SHARING_AUDIT 1
> +#endif

Since consumers use #if (not #ifdef), I think an #else would
be on order here, even if (I think) not strictly necessary with
gcc.

Jan
Tamas K Lengyel April 29, 2019, 3:31 p.m. UTC | #2
On Mon, Apr 29, 2019 at 8:57 AM Jan Beulich <JBeulich@suse.com> wrote:
>
> >>> On 26.04.19 at 19:21, <tamas@tklengyel.com> wrote:
> > --- a/xen/include/asm-x86/mem_sharing.h
> > +++ b/xen/include/asm-x86/mem_sharing.h
> > @@ -25,7 +25,9 @@
> >  #include <public/memory.h>
> >
> >  /* Auditing of memory sharing code? */
> > +#ifndef NDEBUG
> >  #define MEM_SHARING_AUDIT 1
> > +#endif
>
> Since consumers use #if (not #ifdef), I think an #else would
> be on order here, even if (I think) not strictly necessary with
> gcc.

Sure.

Tamas
diff mbox series

Patch

diff --git a/xen/include/asm-x86/mem_sharing.h b/xen/include/asm-x86/mem_sharing.h
index 0e77b7d935..52ea91efa0 100644
--- a/xen/include/asm-x86/mem_sharing.h
+++ b/xen/include/asm-x86/mem_sharing.h
@@ -25,7 +25,9 @@ 
 #include <public/memory.h>
 
 /* Auditing of memory sharing code? */
+#ifndef NDEBUG
 #define MEM_SHARING_AUDIT 1
+#endif
 
 typedef uint64_t shr_handle_t;