From: David Vrabel <david.vrabel@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xenproject.org
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Jennifer Herbert <jennifer.herbert@citrix.com>,
Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCHv4 2/5] arm: provide add_sized()
Date: Mon, 11 May 2015 15:45:23 +0100 [thread overview]
Message-ID: <5550C083.2080106@citrix.com> (raw)
In-Reply-To: <1431355025-20468-3-git-send-email-david.vrabel@citrix.com>
On 11/05/15 15:37, David Vrabel wrote:
> add_sized(ptr, inc) adds inc to the value at ptr using only the correct
> size of loads and stores for the type of *ptr. The add is /not/ atomic.
>
> This is needed for ticket locks to ensure the increment of the head ticket
> does not affect the tail ticket.
[...]
>
> +#define add_sized(p, x) ({ \
> + typeof(*p) __x = (x); \
> + switch ( sizeof(*p) ) \
> + { \
> + case 1: add_u8_sized((uint8_t *)p, (uint8_t)__x); break; \
> + case 2: add_u16_sized((uint16_t *)p, (uint16_t)__x); break; \
> + case 4: add_u32_sized((uint32_t *)p, (uint32_t)__x); break; \
> + default: __bad_atomic_size(); break; \
> + } \
> + __x; \
I should have cleaned up this arm implementation in the same way I did
x86. Please drop this "__x;" before committing, or I can resubmit if it
is preferred.
Sorry.
David
next prev parent reply other threads:[~2015-05-11 14:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 14:37 [PATCHv5 0/5] Use ticket locks for spinlocks David Vrabel
2015-05-11 14:37 ` [PATCHv4 1/5] x86: provide add_sized() David Vrabel
2015-05-13 9:23 ` Jan Beulich
2015-05-13 9:35 ` David Vrabel
2015-05-13 9:48 ` Jan Beulich
2015-05-11 14:37 ` [PATCHv4 2/5] arm: " David Vrabel
2015-05-11 14:45 ` David Vrabel [this message]
2015-05-13 9:26 ` Jan Beulich
2015-05-11 14:37 ` [PATCHv4 3/5] xen: use ticket locks for spin locks David Vrabel
2015-05-13 9:31 ` Jan Beulich
2015-05-14 10:36 ` Tim Deegan
2015-05-14 20:05 ` Jan Beulich
2015-05-14 20:51 ` Jan Beulich
2015-05-14 20:55 ` Tim Deegan
2015-05-14 21:01 ` Jan Beulich
2015-05-11 14:37 ` [PATCHv4 4/5] x86, arm: remove asm/spinlock.h from all architectures David Vrabel
2015-05-11 14:37 ` [PATCHv4 5/5] x86: reduce struct hvm_domain size David Vrabel
2015-05-14 11:24 ` Tim Deegan
2015-05-14 12:08 ` 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=5550C083.2080106@citrix.com \
--to=david.vrabel@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=jennifer.herbert@citrix.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--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 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.