From: Jennifer Herbert <Jennifer.Herbert@citrix.com>
To: Jan Beulich <JBeulich@suse.com>, David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org, Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCHv1 3/4] spinlock: shrink struct lock_debug
Date: Tue, 19 Jan 2016 12:31:25 +0000 [thread overview]
Message-ID: <569E2C9D.2040901@citrix.com> (raw)
In-Reply-To: <5674495102000078000C169A@prv-mh.provo.novell.com>
On 18/12/15 16:58, Jan Beulich wrote:
>>>> On 18.12.15 at 15:09, <david.vrabel@citrix.com> wrote:
>> --- a/xen/common/spinlock.c
>> +++ b/xen/common/spinlock.c
>> @@ -16,7 +16,7 @@ static atomic_t spin_debug __read_mostly = ATOMIC_INIT(0);
>>
>> static void check_lock(struct lock_debug *debug)
>> {
>> - int irq_safe = !local_irq_is_enabled();
>> + s16 irq_safe = !local_irq_is_enabled();
>>
>> if ( unlikely(atomic_read(&spin_debug) <= 0) )
>> return;
> I can't figure out why this odd looking change is needed.
>
> Jan
>
This patch shrinks struct lock_debug's irq_safe member. Since you end
up with many instances of this embedded in other structures such as
struct domain, this become a useful saving in memory. At one point, I
had an issue with struct domain exceeding 4k, which caused trouble.
Given the change to struct_lock debug, this local variable irq_safe, is
compared with it, and used in cmpxchg with it it, and therefore should
match type.
- Jenny
next prev parent reply other threads:[~2016-01-19 12:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-18 14:09 [PATCHv1 0/4] spinlock: add qrwlocks David Vrabel
2015-12-18 14:09 ` [PATCHv1 1/4] atomic: replace atomic_compareandswap() with atomic_cmpxchg() David Vrabel
2015-12-18 17:01 ` Jan Beulich
2016-01-21 15:19 ` Ian Campbell
2015-12-18 14:09 ` [PATCHv1 2/4] x86/domain: Compile with lock_profile=y enabled David Vrabel
2015-12-18 14:09 ` [PATCHv1 3/4] spinlock: shrink struct lock_debug David Vrabel
2015-12-18 16:58 ` Jan Beulich
2016-01-19 12:31 ` Jennifer Herbert [this message]
2016-01-19 13:04 ` Jan Beulich
2015-12-18 14:09 ` [PATCHv1 4/4] spinlock: add fair read-write locks David Vrabel
2015-12-22 13:54 ` Jan Beulich
2016-01-18 16:44 ` Jennifer Herbert
2015-12-18 15:47 ` [PATCHv1 0/4] spinlock: add qrwlocks Ian Campbell
2015-12-18 15:49 ` David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=569E2C9D.2040901@citrix.com \
--to=jennifer.herbert@citrix.com \
--cc=JBeulich@suse.com \
--cc=david.vrabel@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).