From: Tejun Heo <tj@kernel.org>
To: Roman Gushchin <guro@fb.com>
Cc: Jens Axboe <axboe@kernel.dk>, Song Liu <songliubraving@fb.com>,
Dennis Zhou <dennis@kernel.org>,
linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 1/4] percpu_ref: introduce PERCPU_REF_ALLOW_REINIT flag
Date: Thu, 9 May 2019 09:53:43 -0700 [thread overview]
Message-ID: <20190509165343.GX374014@devbig004.ftw2.facebook.com> (raw)
In-Reply-To: <20190507170150.64051-1-guro@fb.com>
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
next prev parent reply other threads:[~2019-05-09 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-07 17:01 [PATCH 1/4] percpu_ref: introduce PERCPU_REF_ALLOW_REINIT flag Roman Gushchin
2019-05-07 17:01 ` [PATCH 2/4] io_uring: initialize percpu refcounters using PERCU_REF_ALLOW_REINIT Roman Gushchin
2019-05-07 17:01 ` [PATCH 3/4] md: " Roman Gushchin
2019-05-07 17:01 ` [PATCH 4/4] percpu_ref: release percpu memory early without PERCPU_REF_ALLOW_REINIT Roman Gushchin
2019-05-09 16:53 ` Tejun Heo [this message]
2019-05-09 17:52 ` [PATCH 1/4] percpu_ref: introduce PERCPU_REF_ALLOW_REINIT flag Dennis Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190509165343.GX374014@devbig004.ftw2.facebook.com \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=dennis@kernel.org \
--cc=guro@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=songliubraving@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox