Re: [PATCH V2 2/2] blk-mq: fix blk_mq_tagset_busy_iter

From: Guenter Roeck
Date: Thu Aug 02 2018 - 14:37:25 EST


On Fri, Aug 03, 2018 at 01:49:37AM +0800, Ming Lei wrote:
> Commit d250bf4e776ff09d5("blk-mq: only iterate over inflight requests
> in blk_mq_tagset_busy_iter") uses 'blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT'
> to replace 'blk_mq_request_started(req)', this way is wrong, and causes
> lots of test system hang during booting.
>
> Fix the issue by using blk_mq_request_started(req) inside bt_tags_iter().
>
> Fixes: d250bf4e776ff09d5 ("blk-mq: only iterate over inflight requests in blk_mq_tagset_busy_iter")
> Cc: Josef Bacik <josef@xxxxxxxxxxxxxx>
> Cc: Christoph Hellwig <hch@xxxxxx>
> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: Mark Brown <broonie@xxxxxxxxxx>
> Cc: Matt Hart <matthew.hart@xxxxxxxxxx>
> Cc: Johannes Thumshirn <jthumshirn@xxxxxxx>
> Cc: John Garry <john.garry@xxxxxxxxxx>
> Cc: Hannes Reinecke <hare@xxxxxxxx>,
> Cc: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>,
> Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
> Cc: linux-scsi@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Reported-by: Mark Brown <broonie@xxxxxxxxxx>
> Reported-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>

Tested-by: Guenter Roeck <linux@xxxxxxxxxxxx>

Test builds (with both patches applied):

Building mips:malta_defconfig:nosmp ... running ..... passed
Building mips:malta_defconfig:smp ... running ..... passed
Building x86_64:q35:Broadwell-noTSX:defconfig:smp:sata:rootfs ... running ..... passed
Building x86_64:q35:IvyBridge:defconfig:smp:nvme:rootfs ... running ..... passed
Building x86_64:q35:SandyBridge:defconfig:smp:usb:rootfs ... running ...... passed
Building x86_64:q35:Haswell:defconfig:smp:usb-uas:rootfs ... running ...... passed
Building x86_64:q35:Skylake-Client:defconfig:smp:mmc:rootfs ... running ...... passed
Building x86_64:q35:Conroe:defconfig:smp:scsi[DC395]:rootfs ... running ....... passed
Building x86_64:q35:Nehalem:defconfig:smp:scsi[AM53C974]:rootfs ... running ....... passed
Building x86_64:q35:Westmere-IBRS:defconfig:smp:scsi[53C810]:rootfs ... running ...... passed
Building x86_64:q35:Skylake-Server:defconfig:smp:scsi[53C895A]:rootfs ... running ...... passed
Building x86_64:pc:EPYC:defconfig:smp:scsi[MEGASAS]:rootfs ... running ...... passed
Building x86_64:q35:EPYC-IBPB:defconfig:smp:scsi[MEGASAS2]:rootfs ... running ..... passed
Building x86_64:q35:Opteron_G5:defconfig:smp:scsi[FUSION]:rootfs ... running ..... passed
Building x86_64:pc:phenom:defconfig:smp:initrd ... running ..... passed
Building x86_64:q35:Opteron_G1:defconfig:smp:initrd ... running ..... passed
Building x86_64:pc:Opteron_G2:defconfig:smp:sata:rootfs ... running ..... passed
Building x86_64:q35:core2duo:defconfig:smp:usb:rootfs ... running ...... passed
Building x86_64:pc:Opteron_G3:defconfig:nosmp:usb:rootfs ... running ....... passed
Building x86_64:q35:Opteron_G4:defconfig:nosmp:sata:rootfs ... running ...... passed

Guenter