From: Ming Lei <ming.lei@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
Veronika Kabatova <vkabatov@redhat.com>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Jens Axboe <axboe@kernel.dk>,
Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH V6 1/2] percpu_ref: reduce memory footprint of percpu_ref in fast path
Date: Thu, 1 Oct 2020 23:38:06 +0800 [thread overview]
Message-ID: <20201001153806.GA23222@T590> (raw)
In-Reply-To: <20200930160015.GC4441@mtj.duckdns.org>
On Wed, Sep 30, 2020 at 12:00:15PM -0400, Tejun Heo wrote:
> On Wed, Sep 30, 2020 at 04:26:56PM +0800, Ming Lei wrote:
> > diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
> > index 87d8a38bdea1..1d6ed9ca23dd 100644
> > --- a/include/linux/percpu-refcount.h
> > +++ b/include/linux/percpu-refcount.h
> > @@ -92,18 +92,23 @@ enum {
> > PERCPU_REF_ALLOW_REINIT = 1 << 2,
> > };
> >
> > -struct percpu_ref {
> > +struct percpu_ref_data {
> > atomic_long_t count;
> > - /*
> > - * The low bit of the pointer indicates whether the ref is in percpu
> > - * mode; if set, then get/put will manipulate the atomic_t.
> > - */
> > - unsigned long percpu_count_ptr;
> > percpu_ref_func_t *release;
> > percpu_ref_func_t *confirm_switch;
> > bool force_atomic:1;
> > bool allow_reinit:1;
> > struct rcu_head rcu;
> > + struct percpu_ref *ref;
> > +};
> > +
> > +struct percpu_ref {
> > + /*
> > + * The low bit of the pointer indicates whether the ref is in percpu
> > + * mode; if set, then get/put will manipulate the atomic_t.
> > + */
> > + unsigned long percpu_count_ptr;
> > + struct percpu_ref_data *data;
> > };
>
> Can you please add a comment explaining why the two structs are split?
Sure, will do that in next version.
Thanks,
Ming
next prev parent reply other threads:[~2020-10-01 15:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 8:26 [PATCH V6 0/2] percpu_ref & block: reduce memory footprint of percpu_ref in fast path Ming Lei
2020-09-30 8:26 ` [PATCH V6 1/2] percpu_ref: " Ming Lei
2020-09-30 16:00 ` Tejun Heo
2020-10-01 15:38 ` Ming Lei [this message]
2020-09-30 8:26 ` [PATCH V6 2/2] block: move 'q_usage_counter' into front of 'request_queue' Ming Lei
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=20201001153806.GA23222@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sagi@grimberg.me \
--cc=tj@kernel.org \
--cc=vkabatov@redhat.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