Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1460780

Re: [PATCH 1/1] percpu-refcount: init ->confirm_switch member properly

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] percpu-refcount: init ->confirm_switch member properly
Date 2016-08-11 22:30 +0200
Message-ID <s54M2-fM-15@gated-at.bofh.it> (permalink)
References <s51XR-6Q4-57@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 11, 2016 at 07:27:09PM +0200, Roman Pen wrote:
> This patch targets two things which are related to ->confirm_switch:
> 
>  1. Init ->confirm_switch pointer with NULL on percpu_ref_init() or
>     kernel frightfully complains with WARN_ON_ONCE(ref->confirm_switch)
>     at __percpu_ref_switch_to_atomic if memory chunk was not properly
>     zeroed.
> 
>  2. Warn if RCU callback is still in progress on percpu_ref_exit().
>     The race still exists, because percpu_ref_call_confirm_rcu()
>     drops ->confirm_switch to NULL early, but that is only a warning
>     and still the caller is responsible that ref is no longer in
>     active use.  Hopefully that can help to catch incorrect usage
>     of percpu-refcount.
> 
> Signed-off-by: Roman Pen <roman.penyaev@profitbricks.com>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: linux-kernel@vger.kernel.org

Applied to percpu/for-4.9.

Thanks.

-- 
tejun

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] percpu-refcount: init ->confirm_switch member properly Roman Pen <roman.penyaev@profitbricks.com> - 2016-08-11 19:30 +0200
  Re: [PATCH 1/1] percpu-refcount: init ->confirm_switch member  properly Tejun Heo <tj@kernel.org> - 2016-08-11 22:30 +0200

csiph-web