From patchwork Sat Oct 29 00:20:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9402905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3638A6022E for ; Sat, 29 Oct 2016 00:20:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24A2B2A8A8 for ; Sat, 29 Oct 2016 00:20:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 194272A8BB; Sat, 29 Oct 2016 00:20:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FE212A8A8 for ; Sat, 29 Oct 2016 00:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934042AbcJ2AUm (ORCPT ); Fri, 28 Oct 2016 20:20:42 -0400 Received: from mail-cys01nam02on0076.outbound.protection.outlook.com ([104.47.37.76]:33977 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752423AbcJ2AUj (ORCPT ); Fri, 28 Oct 2016 20:20:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=znGgdyhqjvjpu2bICXIKVm1i272mcSHwwPKVKUJYc8A=; b=AJUEswJEY+qImbXLT0O02FT8FMuFeLaaymGOUeluCICTDaYOpCl1cGgLwzPdO6fidK0j0HAzqDLxXH3SREiHi30DhWiSOTpJXH35iwPovkKVtY0b5Tee1OhJQzXRmQaUZm2ZwGiDxfUQVXkPZUJb1qP7oEn0kEtmMM7R2Ki0WeM= Received: from CY4PR02CA0026.namprd02.prod.outlook.com (10.175.57.140) by BY1PR02MB1163.namprd02.prod.outlook.com (10.162.108.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Sat, 29 Oct 2016 00:20:35 +0000 Received: from BN1AFFO11FD009.protection.gbl (2a01:111:f400:7c10::113) by CY4PR02CA0026.outlook.office365.com (2603:10b6:903:117::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12 via Frontend Transport; Sat, 29 Oct 2016 00:20:35 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; linux.vnet.ibm.com; dkim=none (message not signed) header.d=none;linux.vnet.ibm.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BN1AFFO11FD009.mail.protection.outlook.com (10.58.52.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.5 via Frontend Transport; Sat, 29 Oct 2016 00:20:34 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 0A.A0.61581.CF8E3185; Fri, 28 Oct 2016 17:10:37 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Fri, 28 Oct 2016 17:20:32 -0700 X-AuditID: 0ac94371-607ff7000000f08d-f4-5813e8fc318b Received: from exp-402881.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id DF.3B.03615.05BE3185; Fri, 28 Oct 2016 17:20:32 -0700 (PDT) Subject: [PATCH v5 05/14] blk-mq: Avoid that requeueing starts stopped queues To: Jens Axboe References: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3@sandisk.com> CC: Christoph Hellwig , James Bottomley , "Martin K. Petersen" , Mike Snitzer , Doug Ledford , Keith Busch , Ming Lei , "Konrad Rzeszutek Wilk" , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Laurence Oberman , "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-nvme@lists.infradead.org" From: Bart Van Assche Message-ID: <8d5b97cb-429a-e451-ad2e-ad63a3f94dfd@sandisk.com> Date: Fri, 28 Oct 2016 17:20:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsXCddJ5ke7fF8IRBjcvsVr833OMzeLl+Q+s FitXH2WyWDUxz+Le0S9MFssWP2W02HtL22L+sqfsFs8O9bJYdF/fwWZx/sMrJovlx/8xWcw4 v5jVom3jV0aL9z+uszvwe7yePIHRY2LzO3aPnbPusnss3vOSyePBoc0sHpuX1HvsvtnA5vHx 6S0Wj/f7rrJ5fN4kF8AVxWWTkpqTWZZapG+XwJXRMPsDY0G7QsWzU2fYGhifSXUxcnJICJhI 7G3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LFzCA2s4C6xJ95l6BseYnmrbOZJzDyzULSMgtJ2SwkZQsYmVcxiuVm5hTnpmcWGBrpFSfm pWQWZ+sl5+duYoRETNQOxusTzQ8xMnFwSjUw2uz6zvC6RPt8ypOIir9KLUeWz/WxcZ10XeZg H+/smweN63YzTFdaWdj/duKPe37RXOEcVR5/DB0ffzrdFOtRkX5RKDon1y99wubWg6Vye5Jd IlnM7e8f37a5f9tss7y1k6yjvTf3CCopTJXa4mT8Kfj8xDku3Hnt2htW/2Zv4ev9PP86b+lZ JZbijERDLeai4kQAsj/S2UgCAAA= X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(65806001)(33646002)(110136003)(68736007)(65956001)(31686004)(4001350100001)(6916009)(97736004)(23676002)(575784001)(64126003)(86362001)(31696002)(69596002)(76176999)(50466002)(50986999)(47776003)(2870700001)(54356999)(92566002)(36756003)(65826007)(77096005)(106466001)(8936002)(8676002)(4326007)(11100500001)(81166006)(81156014)(2906002)(586003)(305945005)(7846002)(19580405001)(19580395003)(87936001)(8666005)(356003)(7416002)(53416004)(189998001)(5660300001)(2270400002)(2950100002)(83506001)(229853001)(626004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR02MB1163; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD009; 1:S/Wa/HJDRl4irf/uZagSnJSvfx5kMhgiVUU7yT0u6Q76tPJ0EoBJrfqdCMTsIe3idmiUxXHQJOABeuYx7xpHHlPLKonHy3RucqhRTpuB9DlAOd6L0WF6FV3cUdgLLVmREVUywU/XmXfWyGc1Go0dz/Q443GqChCWgITLBTAo4fsy39jekmKGDN/qZk79UcD0lwLwtT55U5Se68buuorT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5dc7Q/MWc12ODUgCkKJy+gxA/VzkmfBSc4l5QBI7KqZoK0uqXPyzHJtUgEAAcO+x5e6bX8LG9qpopoTlGmNgr+jN33rUgEnkXRCJo4kvKC2Rey94zccniufJeAZj8xqYr77h4Rp+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(70601490899591)(104084551191319)(146099531331640)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BY1PR02MB1163; BCL:0; PCL:0; RULEID:; SRVR:BY1PR02MB1163; X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1163; 4:2mgxUn94R/d5HTkbz6lhhElgVZF0Fg7wwnqtBN0048FJ7eLKbDJh81RP2fPifBl4VfjViv+xUYiGLle8YHtBcpRlAciFR4csW+qXA4q/l20Tdy5TgTmuX8YOGrfb+pqFxpzwjM2+BW9e9W61PnyLFVZmPMEDV+zgvOkwc/3f6uny1E+zwKaloRkiAPetv5FX+X/PqjAEszGHJyddQE0QqAv/w9wIL1YHtBqZkaFlNWjrgFJO53Lx+c5z7L++l1r2d6B8Ke9KmY+zRONncQqD0cz+xjfffE+vM4Qazu9lU5CmQhLmT/10mC2cWT+sMi+YKw0h2csCN/p5QnIjM31LZ9O3x17bUEhVLQKFb65I4iAGwqVO5yLm6zDbqih6rUA+dSc5jBLkB2kUrn3PHoHU+O1enBMJ18DYOgbd/WJWexcYnjT4jkW/SJev2bvs0ZALbFIiYRxVHcLFCb2OFhu3lPaouC2GXwVxGtBsAvSsxEcxqlvDckxPiWT1GNol0nykf6Zx1HwKW3Y90nHnSzlbX1ZlIElFT1hg97nnf6oJj+Mz/ZWidujZPPnVGA6d9cUOVjkamlVCXqsunT6gXjzni6tQKMA2N1asELt6T9xSDFw= X-Forefront-PRVS: 01106E96F6 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjAy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Nj?= =?utf-8?B?SURrbC9Hd0FLZklhb3NxdEJMTHlVOHF4dGlKUzVLZUh1d1E9PQ==?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1163; 6:McbQ3S5WfBXKxXW4AIdUV8/N3u1HE2Gi3NYI3TwgFlcU+U1pblBHrU71+wrjIgraG0z05bIl1DwCrKK1Ma+U/qs4z7uu3onR3tFA45/6u6erQhA7ANMPGumU1AaCuf94/CIFOui9uK2EEHNH9/yU3cT9sYTjvoA7yeKRek1VxQvKww+2pp6tkxRqwnbnnYwFIVesr2GZD4jvPlcYiquuT/2GCOhe0jt0rLrEkbo2Hx256oH8x3Q7674fadKwV7jtEFelmgwtcTOum2P7J/ZY85f0uR+JjGHOXg0fQgpqDEipGYrN4U7ROsi+LNLTlivxCA2+riiywhmYZFfJFwSN6Q==; 5:nBo/DL/opDw6Yuge399hBANjg8ARxszdfROA6R31YYgIUT+INgQVFuuR9m7HmZfWcTjLZlhpsy4qJxAS8cGfXZJjYinyIZHr01I4mqfF34alTgQ+OWAmsZiG2l7d+P1rwNJgWf3BjL5mNHAIANdldw==; 24:V5lbUWTlATLTJsnWK8rL0jp/1teuSpsDPiHXuih8HJWH+g7wq14gU6ndEC0CBJvv3WIbiCr5DHhh7EvN3tEgBWUpUhd57k+CfD1sm0dEvbM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1163; 7:qKrCrSIF25X4G/10/6jSEGIZwq9J1gNQWUjjU2KqGC1SZgkY+jMJJ4rpxYWIE/lFE2dYxZZl9jftlyddkaqZwglvSamrdJ60GQGJsJqJ3d1Th6wivh+1FvlU08HWtnwPcDEX+Rs0j0nd8vxjhWMQjVmy32vBIlt+uSS9KfSAZhwHYk2tonV9y+fFL47r6UZ+DeH/WJaxKvscofUtBc/9U9SK1NplrNdZMTvfKOPULRtT8OZ89zaZrEitJ9b0y1VonqQkGF8ml4JG1JqZQctZaGXPbpTa3ab453bhc14VgfpRMG0NNBV5hvSuPymVDxlVevx9wZpg+7i0DJ3Z3zi16Io995RSXqCBnbG5BKUkOOY=; 20:WPjBnEKpVIkUeUmHNJl1gm4BfjUS8t7FM4CP57Qxd0tlwS1YjJXU2DNyz6egVGizzgumsmJbWAYhXyeiW4NjzRPtwk1lOjwkS+zCWWocAIicoSE9nGUXWnBtZpXn5ZRwrCWlmE6pjFH8XGlHnSfkC568gN/nI4o00RK6TXWIAGC9bH5GYWdII7pZN7y+dijiorS3tMQCZiEPj3v5Sy/RgFHTrk0srs5RsMy+dugfbwwPAYfrCqas08KGuFMA1YK4 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2016 00:20:34.0208 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR02MB1163 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since blk_mq_requeue_work() starts stopped queues and since execution of this function can be scheduled after a queue has been stopped it is not possible to stop queues without using an additional state variable to track whether or not the queue has been stopped. Hence modify blk_mq_requeue_work() such that it does not start stopped queues. My conclusion after a review of the blk_mq_stop_hw_queues() and blk_mq_{delay_,}kick_requeue_list() callers is as follows: * In the dm driver starting and stopping queues should only happen if __dm_suspend() or __dm_resume() is called and not if the requeue list is processed. * In the SCSI core queue stopping and starting should only be performed by the scsi_internal_device_block() and scsi_internal_device_unblock() functions but not by any other function. Although the blk_mq_stop_hw_queue() call in scsi_queue_rq() may help to reduce CPU load if a LLD queue is full, figuring out whether or not a queue should be restarted when requeueing a command would require to introduce additional locking in scsi_mq_requeue_cmd() to avoid a race with scsi_internal_device_block(). Avoid this complexity by removing the blk_mq_stop_hw_queue() call from scsi_queue_rq(). * In the NVMe core only the functions that call blk_mq_start_stopped_hw_queues() explicitly should start stopped queues. * A blk_mq_start_stopped_hwqueues() call must be added in the xen-blkfront driver in its blkif_recover() function. Signed-off-by: Bart Van Assche Cc: Konrad Rzeszutek Wilk Cc: Roger Pau Monné Cc: Mike Snitzer Cc: James Bottomley Cc: Martin K. Petersen Reviewed-by: Sagi Grimberg --- block/blk-mq.c | 6 +----- drivers/block/xen-blkfront.c | 1 + drivers/md/dm-rq.c | 7 +------ drivers/scsi/scsi_lib.c | 1 - 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index c8ae970..fe367b5 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -503,11 +503,7 @@ static void blk_mq_requeue_work(struct work_struct *work) blk_mq_insert_request(rq, false, false, false); } - /* - * Use the start variant of queue running here, so that running - * the requeue work will kick stopped queues. - */ - blk_mq_start_hw_queues(q); + blk_mq_run_hw_queues(q, false); } void blk_mq_add_to_requeue_list(struct request *rq, bool at_head) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 9908597..60fff99 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -2045,6 +2045,7 @@ static int blkif_recover(struct blkfront_info *info) BUG_ON(req->nr_phys_segments > segs); blk_mq_requeue_request(req); } + blk_mq_start_stopped_hwqueues(info->rq); blk_mq_kick_requeue_list(info->rq); while ((bio = bio_list_pop(&info->bio_list)) != NULL) { diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index 1d0d2ad..1794de5 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -338,12 +338,7 @@ static void dm_old_requeue_request(struct request *rq) static void __dm_mq_kick_requeue_list(struct request_queue *q, unsigned long msecs) { - unsigned long flags; - - spin_lock_irqsave(q->queue_lock, flags); - if (!blk_queue_stopped(q)) - blk_mq_delay_kick_requeue_list(q, msecs); - spin_unlock_irqrestore(q->queue_lock, flags); + blk_mq_delay_kick_requeue_list(q, msecs); } void dm_mq_kick_requeue_list(struct mapped_device *md) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 2cca9cf..126a784 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1941,7 +1941,6 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, out: switch (ret) { case BLK_MQ_RQ_QUEUE_BUSY: - blk_mq_stop_hw_queue(hctx); if (atomic_read(&sdev->device_busy) == 0 && !scsi_device_blocked(sdev)) blk_mq_delay_queue(hctx, SCSI_QUEUE_DELAY);