lkml.org 
[lkml]   [2019]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] percpu_ref: introduce PERCPU_REF_ALLOW_REINIT flag
On Thu, May 09, 2019 at 09:53:43AM -0700, Tejun Heo wrote:
> On Tue, May 07, 2019 at 10:01:47AM -0700, Roman Gushchin wrote:
> > In most cases percpu reference counters are not switched to the
> > percpu mode after they reach the atomic mode. Some obvious exceptions
> > are reference counters which are initialized into the atomic
> > mode (using PERCPU_REF_INIT_ATOMIC and PERCPU_REF_INIT_DEAD flags),
> > and there are few other exceptions.
> >
> > But in most cases there is no way back, and once the reference counter
> > is switched to the atomic mode, there is no reason to wait for
> > percpu_ref_exit() to release the percpu memory. Of course, the size
> > of a single counter is not so big, but because it can pin the whole
> > percpu block in memory, the memory footprint can be noticeable
> > (e.g. on my 32 CPUs machine a percpu block is 8Mb large).
> >
> > To make releasing of the percpu memory as early as possible, let's
> > introduce the PERCPU_REF_ALLOW_REINIT flag with the following semantics:
> > it has to be set in order to switch a percpu reference counter to the
> > percpu mode after the initialization. PERCPU_REF_INIT_ATOMIC and
> > PERCPU_REF_INIT_DEAD flags will implicitly assume PERCPU_REF_ALLOW_REINIT.
> >
> > This patch doesn't introduce any functional change to avoid any
> > regressions. It will be done later in the patchset after adjusting
> > all call sites, which are reviving percpu counters.
> >
> > Signed-off-by: Roman Gushchin <guro@fb.com>
>
> For all patches in the series:
>
> Acked-by: Tejun Heo <tj@kenrel.org>
>
> Thanks.
>
> --
> tejun

Great, I've applied this to for-5.3.

Thanks,
Dennis

\
 
 \ /
  Last update: 2019-05-09 19:53    [W:0.066 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site