Re: [PATCH] Generic percpu refcounting

From: Tejun Heo
Date: Wed Jun 05 2013 - 03:44:22 EST


On Wed, Jun 05, 2013 at 05:05:09PM +0930, Rusty Russell wrote:
> I think this should be rcu_read_lock(), which is currently equivalent
> but theoretically different.

I suggested using preempt_disable/enable() along with sched RCU. I
thought that was better for some reason but I was probably
misremembering something. rcu_read_lock/unlock() w/ synchronize_rcu()
should be fine too. I don't care either way.

> Does your percpu_ref_kill() *really* need to be nonblocking? (I'd have
> to read your other patches which use this to be sure). Otherwise, just
> use synchronize_rcu(), and get rid of the release function...

synchronize_rcu() can always become problematic and should always be
avoided for generic things which may be used in various ways. They
develop into very long latencies pretty quickly when chained back to
back.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/