xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/libxc: remove volatile keyword for bitmap operations
@ 2012-01-30 12:12 Olaf Hering
  0 siblings, 0 replies; only message in thread
From: Olaf Hering @ 2012-01-30 12:12 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1327925537 -3600
# Node ID 686f053d460da35f26b42b74e2ef41b6aceb5711
# Parent  4374739bd1428aead1c7f49beac6a28031c8d20b
tools/libxc: remove volatile keyword for bitmap operations

All bitmaps maintained by xc_bitops.h are used in single threaded
applications. So nothing will change the bitmaps content, adding
volatile adds just unneeded memory reloads.

xenpaging uses bitmaps alot and using non-volatile versions will slightly
improve performance.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r 4374739bd142 -r 686f053d460d tools/libxc/xc_bitops.h
--- a/tools/libxc/xc_bitops.h
+++ b/tools/libxc/xc_bitops.h
@@ -31,29 +31,29 @@ static inline void bitmap_clear(unsigned
     memset(addr, 0, bitmap_size(nr_bits));
 }
 
-static inline int test_bit(int nr, volatile unsigned long *addr)
+static inline int test_bit(int nr, unsigned long *addr)
 {
     return (BITMAP_ENTRY(nr, addr) >> BITMAP_SHIFT(nr)) & 1;
 }
 
-static inline void clear_bit(int nr, volatile unsigned long *addr)
+static inline void clear_bit(int nr, unsigned long *addr)
 {
     BITMAP_ENTRY(nr, addr) &= ~(1UL << BITMAP_SHIFT(nr));
 }
 
-static inline void set_bit(int nr, volatile unsigned long *addr)
+static inline void set_bit(int nr, unsigned long *addr)
 {
     BITMAP_ENTRY(nr, addr) |= (1UL << BITMAP_SHIFT(nr));
 }
 
-static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline int test_and_clear_bit(int nr, unsigned long *addr)
 {
     int oldbit = test_bit(nr, addr);
     clear_bit(nr, addr);
     return oldbit;
 }
 
-static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline int test_and_set_bit(int nr, unsigned long *addr)
 {
     int oldbit = test_bit(nr, addr);
     set_bit(nr, addr);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-30 12:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-30 12:12 [PATCH] tools/libxc: remove volatile keyword for bitmap operations Olaf Hering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).