[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCHv4 2/3] grant_table: convert grant table rwlock to percpu rwlock



>>> On 18.12.15 at 11:06, <malcolm.crossley@xxxxxxxxxx> 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.