Hey, On Mon, Sep 11, 2017 at 04:55:59PM +0000, Bart Van Assche wrote: > > Probably but that sounds really hairy. I'd much prefer if it could be > > done through the usual kill / confirm / release and re-init. That's > > not a possibility? > > Modifying this patch series such that it uses the confirmation mechanism > when switching from per-cpu to atomic mode should be possible. However, the > wait_event_lock_irq() call in __percpu_ref_switch_mode() is annoying when > calling percpu_ref_kill_and_confirm() from atomic context. How about adding > a nowait version of percpu_ref_kill_and_confirm() that returns a boolean > indicating whether or not this function succeeded? Hmm... so if you know that you won't try to switch again while switching is in progress, it should be fine. That can't be guaranteed? Thanks. -- tejun