From patchwork Fri Jul 27 22:56:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10547789 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6BC1A635 for ; Fri, 27 Jul 2018 22:56:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BB772C685 for ; Fri, 27 Jul 2018 22:56:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FC162C693; Fri, 27 Jul 2018 22:56:23 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 122CF2C68D for ; Fri, 27 Jul 2018 22:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388527AbeG1AUY (ORCPT ); Fri, 27 Jul 2018 20:20:24 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:46623 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731568AbeG1AUY (ORCPT ); Fri, 27 Jul 2018 20:20:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1532732182; x=1564268182; h=from:to:cc:subject:date:message-id; bh=SgFf0xDmkLaJoHJ2bVuHzxl6HfSxLjCnZ3Pf6rc3mss=; b=JdH0AeDMttA0SUmujKI+enFcjzi703jxFCn3tXYjzYkDHZ6jQGPC6t2e cFjIWTO1CxxMRoI2w6hUVrrBUCanjWjKyg3oQ27WnVkk0l70JWtBwJ89b 5C7M7izhkLM1I6vtI7F/qDARV3mMQ+8TMsXLstnEGq0BqSsUBnP9GYIwN dqvoEsXl45RNbdbH8Eqo4hwgSFV/Km3nM/qc+LlewecugxltKBo36B2tt fsTIDFH82iJ847mgh0lixrAhk5V673JbI3rI7TmWg2dWVkx0MfY9q5N71 jwp62KjceKAZoMOWK3toq267fuOkQeyxA0dtQxQdfrjJAW7Lg+zHHMPpG w==; X-IronPort-AV: E=Sophos;i="5.51,411,1526313600"; d="scan'208";a="85204231" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jul 2018 06:56:21 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 27 Jul 2018 15:44:23 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Jul 2018 15:56:22 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche Subject: [PATCH v2 0/5] Improve blk-mq performance Date: Fri, 27 Jul 2018 15:56:15 -0700 Message-Id: <20180727225620.17855-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Jens, The blk-mq timeout handling rework that went upstream during the v4.18 development cycle introduced a performance regression due to the atomic instructions that were added in the hot path. This patch series improves blk-mq performance by reducing the number of atomic instructions in the hot path. This patch series increases the number of IOPS reported by a fio test against the null_blk driver with 15% on an x86_64 system. This patch series applies on top of a merge of your for-next and for-linus branches. This patch series passes the block and srp blktests tests. Bart. Changes compared to v1: - Dropped the patch that renames BLK_EH_DONE into BLK_EH_DONT_RESET_TIMER. - Added a new patch that introduces the timeout handler return code BLK_EH_DONT_COMPLETE. - If blk_mq_complete_request() is called from inside the request timed out function, complete the request immediately to avoid triggering a deadlock. - Instead of introducing one new request state, introduce two new request states, namely MQ_RQ_COMPLETION_DELAYED and MQ_RQ_TIMED_OUT. - Fixed a race condition in blk_mq_change_rq_state(). Bart Van Assche (5): blk-mq: Introduce the timeout handler return code BLK_EH_DONT_COMPLETE block: Remove a superfluous #include directive block: Split blk_add_timer() block: Simplify blk_add_timer() and blk_mq_add_timer() blk-mq: Rework blk-mq timeout handling again Documentation/scsi/scsi_eh.txt | 4 +- block/blk-core.c | 3 + block/blk-mq-debugfs.c | 8 +- block/blk-mq.c | 325 +++++++++++++++++----- block/blk-mq.h | 10 +- block/blk-timeout.c | 116 +++++--- block/blk.h | 1 + drivers/block/nbd.c | 2 +- drivers/message/fusion/mptsas.c | 2 +- drivers/s390/block/dasd.c | 6 +- drivers/scsi/gdth.c | 2 +- drivers/scsi/libiscsi.c | 6 +- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- drivers/scsi/mvumi.c | 2 +- drivers/scsi/qla4xxx/ql4_os.c | 2 +- drivers/scsi/scsi_error.c | 18 +- drivers/scsi/scsi_transport_fc.c | 9 +- drivers/scsi/scsi_transport_srp.c | 4 +- drivers/scsi/ufs/ufshcd.c | 6 +- include/linux/blk-mq.h | 14 - include/linux/blkdev.h | 60 +++- 21 files changed, 417 insertions(+), 185 deletions(-)