Re: [PATCH] locking/percpu_rwsem: Rewrite to not use rwsem

Boqun Feng
2019-08-05T14:43:31Z

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

On Mon, Aug 05, 2019 at 04:02:41PM +0200, Peter Zijlstra wrote:
[...]
>
> static inline void percpu_up_read(struct percpu_rw_semaphore *sem)
> {
> + rwsem_release(&sem->dep_map, 1, _RET_IP_);
> +
> preempt_disable();
> /*
> * Same as in percpu_down_read().
> */
> - if (likely(rcu_sync_is_idle(&sem->rss)))
> + if (likely(rcu_sync_is_idle(&sem->rss))) {
> __this_cpu_dec(*sem->read_count);
> - else
> - __percpu_up_read(sem); /* Unconditional memory barrier */
> - preempt_enable();
> + preempt_enable();
> + return;
> + }
>
> - rwsem_release(&sem->rw_sem.dep_map, 1, _RET_IP_);

Missing a preempt_enable() here?

Regards,
Boqun

> + __percpu_up_read(sem); /* Unconditional memory barrier */
> }
>
[...]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]