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

Re: [Xen-devel] [PATCHv4 1/3] rwlock: Add per-cpu reader-writer lock infrastructure



>>> On 18.12.15 at 11:06, <malcolm.crossley@xxxxxxxxxx> wrote:
> @@ -492,6 +494,50 @@ int _rw_is_write_locked(rwlock_t *lock)
>      return (lock->lock == RW_WRITE_FLAG); /* writer in critical section? */
>  }
>  
> +void _percpu_write_lock(percpu_rwlock_t **per_cpudata,
> +                percpu_rwlock_t *percpu_rwlock)
> +{
> +    unsigned int cpu;
> +    cpumask_t *rwlock_readers = &this_cpu(percpu_rwlock_readers);
> +
> +#ifndef NDEBUG
> +    /* Validate the correct per_cpudata variable has been provided. */
> +    ASSERT(per_cpudata == percpu_rwlock->percpu_owner);
> +#endif

At the first glance the #ifndef looks plain superfluous, but I
understand that it's needed because we once decided to make
ASSERT() evaluate its condition even on non-debug builds.
However, to unclutter the use sites, you should probably put
this into a macro or inline function.

Everything else looks fine to me now.

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®.