* [PATCH] eliminate lock profile pointer from spinlock structure when !LOCK_PROFILE
@ 2012-08-07 11:41 Jan Beulich
2012-08-07 12:14 ` Keir Fraser
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2012-08-07 11:41 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 933 bytes --]
This pointer is never used for anything, and needlessly increases the
memory footprint of various pieces of data.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -115,11 +115,10 @@ extern void spinlock_profile_reset(unsig
#else
-struct lock_profile { };
struct lock_profile_qhead { };
#define SPIN_LOCK_UNLOCKED \
- { _RAW_SPIN_LOCK_UNLOCKED, 0xfffu, 0, _LOCK_DEBUG, NULL }
+ { _RAW_SPIN_LOCK_UNLOCKED, 0xfffu, 0, _LOCK_DEBUG }
#define DEFINE_SPINLOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED
#define spin_lock_init_prof(s, l) spin_lock_init(&((s)->l))
@@ -133,7 +132,9 @@ typedef struct spinlock {
u16 recurse_cpu:12;
u16 recurse_cnt:4;
struct lock_debug debug;
+#ifdef LOCK_PROFILE
struct lock_profile *profile;
+#endif
} spinlock_t;
[-- Attachment #2: lock-profile-no-overhead.patch --]
[-- Type: text/plain, Size: 1004 bytes --]
eliminate lock profile pointer from spinlock structure when !LOCK_PROFILE
This pointer is never used for anything, and needlessly increases the
memory footprint of various pieces of data.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -115,11 +115,10 @@ extern void spinlock_profile_reset(unsig
#else
-struct lock_profile { };
struct lock_profile_qhead { };
#define SPIN_LOCK_UNLOCKED \
- { _RAW_SPIN_LOCK_UNLOCKED, 0xfffu, 0, _LOCK_DEBUG, NULL }
+ { _RAW_SPIN_LOCK_UNLOCKED, 0xfffu, 0, _LOCK_DEBUG }
#define DEFINE_SPINLOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED
#define spin_lock_init_prof(s, l) spin_lock_init(&((s)->l))
@@ -133,7 +132,9 @@ typedef struct spinlock {
u16 recurse_cpu:12;
u16 recurse_cnt:4;
struct lock_debug debug;
+#ifdef LOCK_PROFILE
struct lock_profile *profile;
+#endif
} spinlock_t;
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] eliminate lock profile pointer from spinlock structure when !LOCK_PROFILE
2012-08-07 11:41 [PATCH] eliminate lock profile pointer from spinlock structure when !LOCK_PROFILE Jan Beulich
@ 2012-08-07 12:14 ` Keir Fraser
0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2012-08-07 12:14 UTC (permalink / raw)
To: Jan Beulich, xen-devel
On 07/08/2012 12:41, "Jan Beulich" <JBeulich@suse.com> wrote:
> This pointer is never used for anything, and needlessly increases the
> memory footprint of various pieces of data.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Good catch.
Acked-by: Keir Fraser <keir@xen.org>
> --- a/xen/include/xen/spinlock.h
> +++ b/xen/include/xen/spinlock.h
> @@ -115,11 +115,10 @@ extern void spinlock_profile_reset(unsig
>
> #else
>
> -struct lock_profile { };
> struct lock_profile_qhead { };
>
> #define SPIN_LOCK_UNLOCKED
> \
> - { _RAW_SPIN_LOCK_UNLOCKED, 0xfffu, 0, _LOCK_DEBUG, NULL }
> + { _RAW_SPIN_LOCK_UNLOCKED, 0xfffu, 0, _LOCK_DEBUG }
> #define DEFINE_SPINLOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED
>
> #define spin_lock_init_prof(s, l) spin_lock_init(&((s)->l))
> @@ -133,7 +132,9 @@ typedef struct spinlock {
> u16 recurse_cpu:12;
> u16 recurse_cnt:4;
> struct lock_debug debug;
> +#ifdef LOCK_PROFILE
> struct lock_profile *profile;
> +#endif
> } spinlock_t;
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-07 12:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07 11:41 [PATCH] eliminate lock profile pointer from spinlock structure when !LOCK_PROFILE Jan Beulich
2012-08-07 12:14 ` Keir Fraser
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).