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

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

>>> On 20.11.15 at 17:03, <malcolm.crossley@xxxxxxxxxx> wrote:
> @@ -208,8 +210,6 @@ active_entry_acquire(struct grant_table *t, grant_ref_t e)
>  {
>      struct active_grant_entry *act;
> -    ASSERT(rw_is_locked(&t->lock));

Even if not covering all cases, I don't think this should be dropped,
just like you don't drop rw_is_write_locked() asserts. Would properly
replacing this be rather expensive?

> @@ -3180,7 +3178,7 @@ grant_table_create(
>          goto no_mem_0;
>      /* Simple stuff. */
> -    rwlock_init(&t->lock);
> +    percpu_rwlock_resource_init(&t->lock);

Considering George's general comment (on patch 1), would it perhaps
make sense to store (in debug builds) the per-CPU variable's offset
in the lock structure, having percpu_{read,write}_lock() verify it? Or
at the very least have gt_{read,write}_lock() wrappers, thus
avoiding the need to explicitly pass grant_rwlock at each use site? I
certainly agree with George that we should make it as hard as
possible for someone to get using these constructs wrong.


Xen-devel mailing list



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