All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
	Omar Sandoval <osandov@fb.com>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	Sumanesh Samanta <sumanesh.samanta@broadcom.com>,
	"Ewan D . Milne" <emilne@redhat.com>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH V7 00/13] blk-mq/scsi: tracking device queue depth via sbitmap
Date: Wed, 3 Feb 2021 19:14:02 +0800	[thread overview]
Message-ID: <20210203111402.GA1065845@T590> (raw)
In-Reply-To: <yq1im7bwiif.fsf@ca-mkp.ca.oracle.com>

Hi Martin,

On Mon, Feb 01, 2021 at 05:33:52PM -0500, Martin K. Petersen wrote:
> 
> Ming,
> 
> > BTW, which tree are you based for applying this patchset?
> 
> 5.12/scsi-queue
> 
> > I apply the patchset against for-5.12/block, and run it on kvm with
> > 'megasas' device(LSI MegaRAID SAS 1078), looks it works well, and not
> > see the hang issue.
> 
> I tried with for-5.12/block and it still breaks for me. Things work fine
> up until:
> 
> scsi: core: Replace sdev->device_busy with sbitmap
> 
> After that patch is applied no disks are discovered on my SAS/FC hosts.

I think the following patch should fix the issue, care to give a test?

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 7d9171e05b58..65807cac6228 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1266,7 +1266,10 @@ static inline int scsi_dev_queue_ready(struct request_queue *q,
 
 	token = sbitmap_get(&sdev->budget_map);
 	if (atomic_read(&sdev->device_blocked)) {
-		if (token >= 0)
+		if (token < 0)
+			goto out;
+
+		if (scsi_device_busy(sdev) > 1)
 			goto out_dec;
 
 		/*
@@ -1282,6 +1285,7 @@ static inline int scsi_dev_queue_ready(struct request_queue *q,
 out_dec:
 	if (token >= 0)
 		sbitmap_put(&sdev->budget_map, token);
+out:
 	return -1;
 }
 

-- 
Ming


  reply	other threads:[~2021-02-03 11:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22  2:33 [PATCH V7 00/13] blk-mq/scsi: tracking device queue depth via sbitmap Ming Lei
2021-01-22  2:33 ` [PATCH V7 01/13] sbitmap: remove sbitmap_clear_bit_unlock Ming Lei
2021-01-22  2:33 ` [PATCH V7 02/13] sbitmap: maintain allocation round_robin in sbitmap Ming Lei
2021-01-22  2:33   ` Ming Lei
2021-01-22  2:33 ` [PATCH V7 03/13] sbitmap: add helpers for updating allocation hint Ming Lei
2021-01-22  2:33 ` [PATCH V7 04/13] sbitmap: move allocation hint into sbitmap Ming Lei
2021-01-22  2:33   ` Ming Lei
2021-01-22  2:33 ` [PATCH V7 05/13] sbitmap: export sbitmap_weight Ming Lei
2021-01-22  2:33 ` [PATCH V7 06/13] sbitmap: add helper of sbitmap_calculate_shift Ming Lei
2021-01-22  2:33 ` [PATCH V7 07/13] blk-mq: add callbacks for storing & retrieving budget token Ming Lei
2021-01-22  2:33 ` [PATCH V7 08/13] blk-mq: return budget token from .get_budget callback Ming Lei
2021-01-22  2:33 ` [PATCH V7 09/13] scsi: put hot fields of scsi_host_template into one cacheline Ming Lei
2021-01-22  2:33 ` [PATCH V7 10/13] megaraid_sas: v2 replace sdev_busy with local counter Ming Lei
2021-01-22  2:33 ` [PATCH V7 11/13] scsi: add scsi_device_busy() to read sdev->device_busy Ming Lei
2021-01-22  2:33 ` [PATCH V7 12/13] scsi: make sure sdev->queue_depth is <= max(shost->can_queue, 1024) Ming Lei
2021-01-22  2:33 ` [PATCH V7 13/13] scsi: replace sdev->device_busy with sbitmap Ming Lei
2021-01-29 18:02 ` [PATCH V7 00/13] blk-mq/scsi: tracking device queue depth via sbitmap Martin K. Petersen
     [not found]   ` <20210131115245.GA1979183@T590>
2021-02-01 22:33     ` Martin K. Petersen
2021-02-03 11:14       ` Ming Lei [this message]
2021-02-04  2:59         ` Martin K. Petersen

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=20210203111402.GA1065845@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=emilne@redhat.com \
    --cc=hare@suse.de \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=osandov@fb.com \
    --cc=sumanesh.samanta@broadcom.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.