On Mon, 2018-08-06 at 10:18 -0700, Tejun Heo wrote:
> I'm worried that this is too inviting for misuses and subtle problems.
> For example, your patch which uses this function uses
> synchronize_rcu() to synchronize against per-cpu counts after the
> first snoop; however, percpu_ref uses sched rcu, not the regular one,
> so depending on the config, this will lead to *really* subtle
> failures.  Even if that gets fixed, it's still leaking percpu-ref
> internal details to its users - details which may change in the future
> and will cause super subtle bugs.
> 
> I'd go for something a lot more specific, like percpu_ref_is_one(), so
> that all the magics can be contained in percpu-ref implementation
> proper.

Hello Tejun,

I will try to come up with an approach that does not require to modify the
per-cpu counter code.

Thanks,

Bart.

Reply via email to