All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Johannes Thumshirn <jthumshirn@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Dick Kennedy <dick.kennedy@avagotech.com>,
	Christoph Hellwig <hch@lst.de>,
	Dan Williams <dan.j.williams@intel.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Sebastian Herbszt <herbszt@gmx.de>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH] Separate target visibility from reaped state information
Date: Wed, 10 Feb 2016 07:34:51 -0800	[thread overview]
Message-ID: <1455118491.2341.6.camel@HansenPartnership.com> (raw)
In-Reply-To: <20160210140522.GT27969@c203.arch.suse.de>

On Wed, 2016-02-10 at 15:05 +0100, Johannes Thumshirn wrote:
> On Wed, Feb 03, 2016 at 11:38:16PM +0100, Sebastian Herbszt wrote:
> > James Bottomley wrote:
> > > On Mon, 2016-02-01 at 19:43 -0800, Bart Van Assche wrote:
> > > > On 01/19/16 17:03, James Bottomley wrote:
> > > > > On Tue, 2016-01-19 at 19:30 -0500, Martin K. Petersen wrote:
> > > > > > > > > > > "Bart" == Bart Van Assche <
> > > > > > > > > > > bart.vanassche@sandisk.com>
> > > > > > > > > > > writes:
> > > > > > 
> > > > > > Bart> Instead of representing the states "visible in sysfs"
> > > > > > and
> > > > > > "has
> > > > > > Bart> been removed from the target list" by a single state
> > > > > > variable,
> > > > > > use
> > > > > > Bart> two variables to represent this information.
> > > > > > 
> > > > > > James: Are you happy with the latest iteration of this?
> > > > > > Should I
> > > > > > queue
> > > > > > it?
> > > > > 
> > > > > Well, I'm OK with the patch: it's a simple transformation of
> > > > > the
> > > > > enumerated state to a two bit state.  What I can't see is how
> > > > > it
> > > > > fixes
> > > > > any soft lockup.
> > > > > 
> > > > > The only change from the current workflow is that the DEL
> > > > > transition
> > > > > (now the reaped flag) is done before the spin lock is dropped
> > > > > which
> > > > > would fix a tiny window for two threads both trying to remove
> > > > > the
> > > > > same
> > > > > target, but there's nothing that could possibly fix an
> > > > > iterative
> > > > > soft
> > > > > lockup caused by restarting the loop, which is what the
> > > > > changelog
> > > > > says.
> > > > 
> > > > Hello James,
> > > > 
> > > > scsi_remove_target() doesn't lock the scan_mutex which means
> > > > that 
> > > > concurrent SCSI scanning activity is not prohibited. Such
> > > > scanning 
> > > > activity can postpone the transition of the state of a SCSI
> > > > target 
> > > > into STARGET_DEL. I think if the scheduler decides to run the
> > > > thread 
> > > > that executes scsi_remove_target() on the same CPU as the
> > > > scanning 
> > > > code after the scanning code has obtained a reap ref and before
> > > > the 
> > > > scanning code has released the reap ref again that the soft
> > > > lockup 
> > > > can be triggered that has been reported by Sebastian Herbszt.
> > > 
> > > OK, I finally understand the scenario;  I'm not sure I understand
> > > how
> > > we're getting concurrent scanning and removal from a simple rmmod
> > > ... I
> > > take it this is insmod rmmod in a tight loop?
> > 
> > I am able to trigger the soft lockup with this test case run once:
> > 
> > modprobe lpfc
> > run fio for 10 seconds
> > rmmod lpfc
> > 
> > My test setup involves running qla2xxx in target mode (SCST) and
> > lpfc as initiator on the same system with one exported volume.
> > 
> > Dick, how did you trigger the lockup?
> > 
> > Sebastian
> 
> Hi James, Bart, Martin
> 
> Have you already decided, which of the two patches you favour and 
> when it'llbe included?
> 
> I have several customer reports that hit this lockup and I don't want 
> to include one of the patches from the list just to find out the 
> other one's is used in mainline.

Well, unless the target allocation bug gets fixed in Bart's, it will
have to be the last_scan one.  It's more a hack than a fix, but I
suppose it will do as a bandaid in the meantime.

If you have diagnosed this at customers, I'd still like to know what's
holding the devices on removal.

Thanks,

James


  reply	other threads:[~2016-02-10 15:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 16:51 [PATCH] Separate target visibility from reaped state information Bart Van Assche
2016-01-18  8:55 ` Johannes Thumshirn
2016-01-20  0:30 ` Martin K. Petersen
2016-01-20  1:03   ` James Bottomley
2016-01-31 17:54     ` Sebastian Herbszt
2016-02-02  1:11       ` Martin K. Petersen
2016-02-02  9:03         ` Johannes Thumshirn
2016-02-03 17:17         ` Christoph Hellwig
2016-02-03 17:54           ` James Bottomley
2016-02-03 21:37         ` *** GMX Spamverdacht *** " Sebastian Herbszt
2016-02-07 22:48         ` Sebastian Herbszt
2016-02-02  3:43     ` Bart Van Assche
2016-02-02 11:46       ` James Bottomley
2016-02-02 18:29         ` Bart Van Assche
2016-02-03  0:43           ` James Bottomley
2016-02-03  1:17             ` Bart Van Assche
2016-02-03  2:01               ` James Bottomley
2016-02-03 22:38         ` Sebastian Herbszt
2016-02-03 22:55           ` James Bottomley
2016-02-03 23:28             ` Sebastian Herbszt
2016-02-07 22:56             ` Sebastian Herbszt
2016-02-10 14:05           ` Johannes Thumshirn
2016-02-10 15:34             ` James Bottomley [this message]
2016-02-10 16:06               ` Johannes Thumshirn

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=1455118491.2341.6.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=dan.j.williams@intel.com \
    --cc=dick.kennedy@avagotech.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=herbszt@gmx.de \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 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.