stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "tj@kernel.org" <tj@kernel.org>
Cc: "jthumshirn@suse.de" <jthumshirn@suse.de>,
	"hch@lst.de" <hch@lst.de>,
	"martin@lichtvoll.de" <martin@lichtvoll.de>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"ming.lei@redhat.com" <ming.lei@redhat.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"oleksandr@natalenko.name" <oleksandr@natalenko.name>,
	"hare@suse.com" <hare@suse.com>,
	"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>
Subject: Re: [PATCH] Change synchronize_rcu() in scsi_device_quiesce() into synchronize_sched()
Date: Mon, 19 Mar 2018 16:18:54 +0000	[thread overview]
Message-ID: <1521476333.2776.9.camel@wdc.com> (raw)
In-Reply-To: <20180319152144.GM2943022@devbig577.frc2.facebook.com>

On Mon, 2018-03-19 at 08:21 -0700, tj@kernel.org wrote:
> On Mon, Mar 19, 2018 at 03:16:07PM +0000, Bart Van Assche wrote:
> > As explained in the comment in scsi_device_quiesce(), the effect of
> > blk_set_preempt_only() must be visible for percpu_ref_tryget() calls that
> > occur after the queue unfreeze triggered by scsi_device_quiesce(). Hence the
> > RCU read lock calls in blk_queue_enter(). Since these RCU read lock calls
> > surround a function call that uses rcu_read_lock_sched(), namely
> > percpu_ref_tryget_live(), we have to use sched-RCU in both blk_queue_enter()
> > and scsi_device_quiesce().
> 
> Let's please not depend on rcu_read_lock_sched() in
> percpu_ref_tryget_live().  That's an implementation detail.  If the
> code needs RCU based synchronization, it should perform them
> explicitly.

Hello Tejun,

The algorithm explained above does not depend on sched-rcu. But because
percpu_ref_tryget_live() uses sched-rcu and because we need to add an RCU lock
around that call we are forced to use sched-rcu. I hope this makes it clear.

Bart.



  reply	other threads:[~2018-03-19 16:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 17:35 [PATCH] Change synchronize_rcu() in scsi_device_quiesce() into synchronize_sched() Bart Van Assche
2018-03-16 21:42 ` Martin Steigerwald
2018-03-16 21:51   ` Bart Van Assche
2018-03-19  9:02     ` Martin Steigerwald
2018-03-19 14:31 ` Tejun Heo
2018-03-19 15:16   ` Bart Van Assche
2018-03-19 15:21     ` tj
2018-03-19 16:18       ` Bart Van Assche [this message]
2018-03-19 16:29         ` tj
2018-03-19 16:57           ` Bart Van Assche
2018-03-19 17:02             ` tj
2018-03-19 20:19               ` Bart Van Assche

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=1521476333.2776.9.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=martin@lichtvoll.de \
    --cc=ming.lei@redhat.com \
    --cc=oleksandr@natalenko.name \
    --cc=stable@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).