linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Bart Van Assche <bvanassche@acm.org>,
	Mike Snitzer <snitzer@redhat.com>,
	dm-devel@redhat.com, linux-scsi@vger.kernel.org
Subject: Re: [dm-devel] dm-mq and end_clone_request()
Date: Mon, 8 Aug 2016 10:32:22 -0400 (EDT)	[thread overview]
Message-ID: <1258167324.126153.1470666742190.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160808134440.67am2eafnd4yrkxl@c203.arch.suse.de>



----- Original Message -----
> From: "Johannes Thumshirn" <jthumshirn@suse.de>
> To: "Laurence Oberman" <loberman@redhat.com>
> Cc: "Bart Van Assche" <bvanassche@acm.org>, "Mike Snitzer" <snitzer@redhat.com>, dm-devel@redhat.com,
> linux-scsi@vger.kernel.org
> Sent: Monday, August 8, 2016 9:44:40 AM
> Subject: Re: [dm-devel] dm-mq and end_clone_request()
> 
> On Mon, Aug 08, 2016 at 08:45:59AM -0400, Laurence Oberman wrote:
> > 
> > 
> > ----- Original Message -----
> > > From: "Bart Van Assche" <bvanassche@acm.org>
> > > To: "Laurence Oberman" <loberman@redhat.com>
> > > Cc: "Mike Snitzer" <snitzer@redhat.com>, dm-devel@redhat.com,
> > > linux-scsi@vger.kernel.org
> > > Sent: Sunday, August 7, 2016 6:31:11 PM
> > > Subject: Re: [dm-devel] dm-mq and end_clone_request()
> > > 
> > > On 08/06/16 07:47, Laurence Oberman wrote:
> > > > [66813.933246] Workqueue: srp_remove srp_remove_work [ib_srp]
> > > > [ ... ]
> > > > [66815.152051]  [<ffffffff814ac790>] scsi_forget_host+0x60/0x70
> > > > [66815.183939]  [<ffffffff814a0137>] scsi_remove_host+0x77/0x110
> > > > [66815.216152]  [<ffffffffa0677be0>] srp_remove_work+0x90/0x200
> > > > [ib_srp]
> > > > [66815.253221]  [<ffffffff810a2e72>] process_one_work+0x152/0x400
> > > > [66815.286221]  [<ffffffff810a3765>] worker_thread+0x125/0x4b0
> > > > [66815.317313]  [<ffffffff810a3640>] ? rescuer_thread+0x380/0x380
> > > > [66815.349770]  [<ffffffff810a9298>] kthread+0xd8/0xf0
> > > > [66815.376082]  [<ffffffff816c6b3f>] ret_from_fork+0x1f/0x40
> > > > [66815.404767]  [<ffffffff810a91c0>] ? kthread_park+0x60/0x60
> > > 
> > > Hello Laurence,
> > > 
> > > This is a callstack I have not yet encountered myself during any test.
> > > Please provide the output of the following commands:
> > > $ gdb /lib/modules/$(uname -r)/build/vmlinux
> > > (gdb) list *(scsi_forget_host+0x60)
> > > 
> > > Thanks,
> > > 
> > > Bart.
> > > 
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > > 
> > [loberman@jumptest1 linux]$ gdb vmlinux
> > GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
> > Copyright (C) 2013 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later
> > <http://gnu.org/licenses/gpl.html>
> > This is free software: you are free to change and redistribute it.
> > There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> > and "show warranty" for details.
> > This GDB was configured as "x86_64-redhat-linux-gnu".
> > For bug reporting instructions, please see:
> > <http://www.gnu.org/software/gdb/bugs/>...
> > Reading symbols from /home/loberman/bart/linux/vmlinux...done.
> > (gdb) list *(scsi_forget_host+0x60)
> > 0xffffffff814ac790 is in scsi_forget_host (drivers/scsi/scsi_scan.c:1895).
> > 1890		list_for_each_entry(sdev, &shost->__devices, siblings) {
> > 1891			if (sdev->sdev_state == SDEV_DEL)
> > 1892				continue;
> > 1893			spin_unlock_irqrestore(shost->host_lock, flags);
> > 1894			__scsi_remove_device(sdev);
> > 1895			goto restart;
> > 1896		}
> > 1897		spin_unlock_irqrestore(shost->host_lock, flags);
> > 1898	}
> > 1899
> 
> 
> So __scsi_remove_device() is also checking for sdev->sdev_state == SDEV_DEL
> and returns if so. If it would have the chance to do so the goto restart
> would
> be hit and we'd reatart the list traverse. The if in turn just continues and
> I've seen endless loops with this pattern (check the 40998193560 ->
> 90a88d6ef88edc -> f05795d3d771f30a7bd commit chain).
> 
> Might want to give the below patch a shot?
> 
> 
> From fee838ebfea88b581994b3f855eab8da20b07fc9 Mon Sep 17 00:00:00 2001
> From: Johannes Thumshirn <jthumshirn@suse.de>
> Date: Mon, 8 Aug 2016 15:41:09 +0200
> Subject: [PATCH] scsi: restart full list search when re-encountering a
> deleted device
> 
> __scsi_remove_device() already checks for reentrency with a deleted device,
> so there's no need to do it in scsi_forget_host() as well.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  drivers/scsi/scsi_scan.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index e0a78f5..1c5a4d6 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -1890,8 +1890,6 @@ void scsi_forget_host(struct Scsi_Host *shost)
>   restart:
>  	spin_lock_irqsave(shost->host_lock, flags);
>  	list_for_each_entry(sdev, &shost->__devices, siblings) {
> -		if (sdev->sdev_state == SDEV_DEL)
> -			continue;
>  		spin_unlock_irqrestore(shost->host_lock, flags);
>  		__scsi_remove_device(sdev);
>  		goto restart;
> --
> 2.9.2
> 
> 
> --
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Johannes,
Thanks very much.
Regards
Laurence

  reply	other threads:[~2016-08-08 14:32 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4ed669ed-beae-76a8-b806-a284565b327a@sandisk.com>
2016-07-20 14:08 ` dm-mq and end_clone_request() Mike Snitzer
2016-07-20 14:27   ` Mike Snitzer
2016-07-20 17:37     ` Bart Van Assche
2016-07-20 18:33       ` Mike Snitzer
2016-07-21 20:58         ` [dm-devel] " Bart Van Assche
2016-07-25 17:53           ` Mike Snitzer
2016-07-25 21:23             ` Mike Snitzer
2016-07-25 22:00               ` Bart Van Assche
2016-07-26  1:16                 ` Mike Snitzer
2016-07-26 22:51                   ` Bart Van Assche
2016-07-27 14:08                     ` Mike Snitzer
2016-07-27 15:52                       ` [dm-devel] " Benjamin Marzinski
2016-07-27 19:06                         ` Bart Van Assche
2016-07-27 19:54                           ` Mike Snitzer
2016-07-27 20:09                   ` Mike Snitzer
2016-07-27 23:05                     ` Bart Van Assche
2016-07-28 13:33                       ` Mike Snitzer
2016-07-28 15:23                         ` Bart Van Assche
2016-07-28 15:40                           ` Mike Snitzer
2016-07-29  6:28                             ` [dm-devel] " Hannes Reinecke
     [not found]         ` <317679447.7168375.1469729769593.JavaMail.zimbra@redhat.com>
     [not found]           ` <6880321d-e14f-169b-d100-6e460dd9bd09@sandisk.com>
     [not found]             ` <1110327939.7305916.1469819453678.JavaMail.zimbra@redhat.com>
     [not found]               ` <a5c1a149-b1a2-b5a4-2207-bdaf32db3cbd@sandisk.com>
     [not found]                 ` <757522831.7667712.1470059860543.JavaMail.zimbra@redhat.com>
     [not found]                   ` <536022978.7668211.1470060125271.JavaMail.zimbra@redhat.com>
     [not found]                     ` <931235537.7668834.1470060339483.JavaMail.zimbra@redhat.com>
     [not found]                       ` <1264951811.7684268.1470065187014.JavaMail.zimbra@redhat.com>
     [not found]                         ` <17da3ab0-233a-2cec-f921-bfd42c953ccc@sandisk.com>
2016-08-01 17:59                           ` Mike Snitzer
2016-08-01 18:55                             ` Bart Van Assche
2016-08-01 19:15                               ` Mike Snitzer
2016-08-01 20:46                               ` Mike Snitzer
2016-08-01 22:41                                 ` Bart Van Assche
2016-08-02 17:45                                   ` Mike Snitzer
2016-08-03  0:19                                     ` Bart Van Assche
2016-08-03  0:40                                       ` Mike Snitzer
2016-08-03  1:33                                         ` Laurence Oberman
2016-08-03  2:10                                           ` Mike Snitzer
2016-08-03  2:18                                             ` Laurence Oberman
2016-08-03  2:55                                               ` Laurence Oberman
2016-08-03 15:10                                                 ` Laurence Oberman
2016-08-03 16:06                                           ` Bart Van Assche
2016-08-03 17:25                                             ` Laurence Oberman
2016-08-03 18:03                                             ` [dm-devel] " Laurence Oberman
2016-08-03 16:55                                         ` Bart Van Assche
2016-08-04 16:10                                           ` Mike Snitzer
2016-08-04 17:42                                             ` Bart Van Assche
2016-08-04 23:58                                               ` Mike Snitzer
2016-08-05  1:07                                                 ` Laurence Oberman
2016-08-05 11:43                                                   ` Laurence Oberman
2016-08-05 15:39                                                     ` Laurence Oberman
2016-08-05 15:43                                                       ` Bart Van Assche
2016-08-05 18:42                                                     ` [dm-devel] " Bart Van Assche
2016-08-06 14:47                                                       ` Laurence Oberman
2016-08-07 22:31                                                         ` [dm-devel] " Bart Van Assche
2016-08-08 12:45                                                           ` Laurence Oberman
2016-08-08 13:44                                                             ` Johannes Thumshirn
2016-08-08 14:32                                                               ` Laurence Oberman [this message]
2016-08-08 14:54                                                               ` Bart Van Assche
2016-08-08 15:11                                                         ` Bart Van Assche
2016-08-08 15:26                                                           ` Laurence Oberman
2016-08-08 15:28                                                             ` Bart Van Assche
2016-08-08 22:39                                                             ` Bart Van Assche
2016-08-08 22:52                                                               ` Laurence Oberman
2016-08-09  0:09                                                                 ` Laurence Oberman
2016-08-09 15:51                                                                   ` Bart Van Assche
2016-08-09 17:12                                                                     ` [dm-devel] " Laurence Oberman
2016-08-09 17:16                                                                       ` Bart Van Assche
2016-08-09 17:21                                                                         ` Laurence Oberman
2016-08-10 21:38                                                                           ` Laurence Oberman
2016-08-11 16:51                                                                             ` Laurence Oberman
2016-08-05 18:40                                                 ` Bart Van Assche
2016-07-21 20:32       ` Mike Snitzer
2016-07-21 20:40         ` [dm-devel] " 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=1258167324.126153.1470666742190.JavaMail.zimbra@redhat.com \
    --to=loberman@redhat.com \
    --cc=bvanassche@acm.org \
    --cc=dm-devel@redhat.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=snitzer@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;
as well as URLs for NNTP newsgroup(s).