From: Bart Van Assche <bvanassche@acm.org>
To: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Ming Lei <ming.lei@redhat.com>,
Jianchao Wang <jianchao.w.wang@oracle.com>,
Hannes Reinecke <hare@suse.com>,
Johannes Thumshirn <jthumshirn@suse.de>
Subject: Re: [PATCH v10 5/8] percpu-refcount: Introduce percpu_ref_resurrect()
Date: Mon, 24 Sep 2018 13:43:35 -0700 [thread overview]
Message-ID: <1537821815.195115.26.camel@acm.org> (raw)
In-Reply-To: <20180924180117.GG1297799@devbig004.ftw2.facebook.com>
On Mon, 2018-09-24 at 11:01 -0700, Tejun Heo wrote:
> Hello, Bart.
>
> On Fri, Sep 21, 2018 at 01:31:19PM -0700, Bart Van Assche wrote:
> > +void percpu_ref_resurrect(struct percpu_ref *ref)
> > +{
> > + unsigned long __percpu *percpu_count;
> > unsigned long flags;
> >
> > spin_lock_irqsave(&percpu_ref_switch_lock, flags);
> >
> > - WARN_ON_ONCE(!percpu_ref_is_zero(ref));
> > + WARN_ON_ONCE(!(ref->percpu_count_ptr & __PERCPU_REF_DEAD));
> > + WARN_ON_ONCE(__ref_is_percpu(ref, &percpu_count));
>
> So, this in itself is fine but I'm a bit worried that this might it
> easier to abuse percpu_ref's dying mode. More specifically, it isn't
> a good idea to depend on percpu_ref's implementation details from
> outside - ie. the only guarantee there ever is that percpu_ref won't
> give out new refs after ->percpu_ref is called - e.g. users can't
> piggy back on implied rcu grace period.
>
> Can you please note that in the function comment? Provided that,
>
> Acked-by: Tejun Heo <tj@kernel.org>
Hi Tejun,
Thanks for the review. But could you please clarify what "after ->percpu_ref
is called" refers to?
Thanks,
Bart.
next prev parent reply other threads:[~2018-09-24 20:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-21 20:31 [PATCH v10 0/8] blk-mq: Implement runtime power management Bart Van Assche
2018-09-21 20:31 ` [PATCH v10 1/8] block: Move power management code into a new source file Bart Van Assche
2018-09-26 14:22 ` Christoph Hellwig
2018-09-21 20:31 ` [PATCH v10 2/8] block, scsi: Change the preempt-only flag into a counter Bart Van Assche
2018-09-26 1:33 ` Martin K. Petersen
2018-09-21 20:31 ` [PATCH v10 3/8] block: Split blk_pm_add_request() and blk_pm_put_request() Bart Van Assche
2018-09-26 14:23 ` Christoph Hellwig
2018-09-21 20:31 ` [PATCH v10 4/8] block: Schedule runtime resume earlier Bart Van Assche
2018-09-26 14:25 ` Christoph Hellwig
2018-09-21 20:31 ` [PATCH v10 5/8] percpu-refcount: Introduce percpu_ref_resurrect() Bart Van Assche
2018-09-24 18:01 ` Tejun Heo
2018-09-24 20:43 ` Bart Van Assche [this message]
2018-09-26 16:59 ` Tejun Heo
2018-09-26 18:48 ` Bart Van Assche
2018-09-21 20:31 ` [PATCH v10 6/8] block: Allow unfreezing of a queue while requests are in progress Bart Van Assche
2018-09-26 14:25 ` Christoph Hellwig
2018-09-21 20:31 ` [PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended Bart Van Assche
2018-09-26 14:27 ` Christoph Hellwig
2018-09-26 14:43 ` Johannes Thumshirn
2018-09-26 14:57 ` Christoph Hellwig
2018-09-26 15:06 ` Johannes Thumshirn
2018-09-26 18:24 ` Bart Van Assche
2018-09-27 6:54 ` Johannes Thumshirn
2018-09-21 20:31 ` [PATCH v10 8/8] blk-mq: Enable support for runtime power management Bart Van Assche
2018-09-26 14:28 ` Christoph Hellwig
2018-09-22 2:32 ` [PATCH v10 0/8] blk-mq: Implement " Jens Axboe
2018-09-26 2:55 ` 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=1537821815.195115.26.camel@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=jianchao.w.wang@oracle.com \
--cc=jthumshirn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=tj@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.