All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: malcolm.crossley@citrix.com
Cc: keir@xen.org, ian.campbell@citrix.com,
	george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
	dario.faggioli@citrix.com, Marcos.Matsunaga@oracle.com,
	stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org
Subject: Re: [PATCHv4 2/3] grant_table: convert grant table rwlock to percpu rwlock
Date: Fri, 18 Dec 2015 04:41:03 -0700	[thread overview]
Message-ID: <5673FEDF02000078000C125D@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1450433179-17827-3-git-send-email-malcolm.crossley@citrix.com>

>>> On 18.12.15 at 11:06, <malcolm.crossley@citrix.com> wrote:
> --- a/xen/include/xen/grant_table.h
> +++ b/xen/include/xen/grant_table.h
> @@ -51,13 +51,35 @@
>  /* The maximum size of a grant table. */
>  extern unsigned int max_grant_frames;
>  
> +DECLARE_PERCPU_RWLOCK_GLOBAL(grant_rwlock);
> +
> +static inline void grant_percpu_read_lock(percpu_rwlock_t *lock)
> +{
> +    percpu_read_lock(grant_rwlock, lock);
> +}
> +
> +static inline void grant_percpu_read_unlock(percpu_rwlock_t *lock)
> +{
> +    percpu_read_unlock(grant_rwlock, lock);
> +}
> +
> +static inline void grant_percpu_write_lock(percpu_rwlock_t *lock)
> +{
> +    percpu_write_lock(grant_rwlock, lock);
> +}
> +
> +static inline void grant_percpu_write_unlock(percpu_rwlock_t *lock)
> +{
> +    percpu_write_unlock(grant_rwlock, lock);
> +}

These should all be taking struct grant_table * arguments, so they
can't be accidentally used on some other per-CPU r/w lock. I also
question the need for the "percpu" in their names.

Jan

  reply	other threads:[~2015-12-18 11:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18 10:06 [PATCHv4 0/3] Implement per-cpu reader-writer locks Malcolm Crossley
2015-12-18 10:06 ` [PATCHv4 1/3] rwlock: Add per-cpu reader-writer lock infrastructure Malcolm Crossley
2015-12-18 11:37   ` Jan Beulich
2015-12-18 10:06 ` [PATCHv4 2/3] grant_table: convert grant table rwlock to percpu rwlock Malcolm Crossley
2015-12-18 11:41   ` Jan Beulich [this message]
2015-12-18 10:06 ` [PATCHv4 3/3] p2m: convert p2m " Malcolm Crossley

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=5673FEDF02000078000C125D@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=Marcos.Matsunaga@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=malcolm.crossley@citrix.com \
    --cc=stefano.stabellini@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 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.