From patchwork Fri Jul 27 16:20:37 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: 10547417 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 D084A112B for ; Fri, 27 Jul 2018 16:20:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C03A82C167 for ; Fri, 27 Jul 2018 16:20:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4B032C1A9; Fri, 27 Jul 2018 16:20:44 +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 3B1B42C1B7 for ; Fri, 27 Jul 2018 16:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730784AbeG0RnT (ORCPT ); Fri, 27 Jul 2018 13:43:19 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:25831 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730205AbeG0RnT (ORCPT ); Fri, 27 Jul 2018 13:43:19 -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=1532708444; x=1564244444; h=from:to:cc:subject:date:message-id; bh=h130Eebedv9zAvsvbn8D6JmgSVc+jMMC8NBuRcUUzYI=; b=dghVfAEJeo5YMz6ilPpVqeJbKXXX9UlXlzGEbal7sMARyLsTjUiqLbWP oKa3joZaVKWA8DzJIu5f5rOwgzbgSB/OQ3Dp6TYvreVO05zi00Ngx1Jyl e2a7SIy6FILhDV6Iux8DRyQaOL3mW7ZeEVwL1BUBBKLUEm7Cw8Ntnf4gd xWbnnS/wWvEb6c48Ce6s4wQSJPbrERzCRBsbfSe9SlagB6FmS6yDrD+EP CtN9AicTR0kCgwSuSnwZMj/bMY/VqUXnV1WukepAF0lYtSnwZgstt7pG/ 9yhY44klIs5YIg9JpHH8Lpi9RlmS3/7K1icUgt+5hCFwN/udwcMF30vdr g==; X-IronPort-AV: E=Sophos;i="5.51,410,1526313600"; d="scan'208";a="86000762" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jul 2018 00:20:43 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 27 Jul 2018 09:09:16 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Jul 2018 09:20:42 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche Subject: [PATCH 0/5] Improve blk-mq performance Date: Fri, 27 Jul 2018 09:20:37 -0700 Message-Id: <20180727162042.13425-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 introduces the number of IOPS reported by the following test with 15% (fifteen per cent) on an x86_64 system: #!/bin/bash if [ -e /sys/kernel/config/nullb ]; then for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d" done fi modprobe -r null_blk [ -e /sys/module/null_blk ] && exit $? modprobe null_blk nr_devices=0 && udevadm settle && cd /sys/kernel/config/nullb && mkdir nullb0 && cd nullb0 && echo 0 > completion_nsec && echo 4096 > blocksize && echo 0 > home_node && echo 1024 > size && echo 0 > memory_backed && echo 1 > power || exit $? ( cd /sys/block/nullb0/queue && echo 2 > rq_affinity ) || exit $? iodepth=${1:-1} runtime=30 args=() if [ "$iodepth" = 1 ]; then args+=(--ioengine=psync) else args+=(--ioengine=libaio --iodepth_batch=$((iodepth/2))) fi args+=(--iodepth=$iodepth --name=nullb0 --filename=/dev/nullb0\ --rw=read --bs=4096 --loops=$((1<<20)) --direct=1 --numjobs=1 --thread\ --runtime=$runtime --invalidate=1 --gtod_reduce=1 --ioscheduler=none) numactl -m 0 -N 0 -- fio "${args[@]}" Bart Van Assche (5): blk-mq: Rename BLK_EH_DONE into BLK_EH_DONT_RESET_TIMER 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 | 3 +- block/blk-mq.c | 284 ++++++++++++++++------ block/blk-mq.h | 10 +- block/blk-timeout.c | 109 +++++---- block/blk.h | 1 + drivers/block/mtip32xx/mtip32xx.c | 2 +- drivers/block/nbd.c | 4 +- drivers/block/null_blk_main.c | 4 +- drivers/message/fusion/mptsas.c | 2 +- drivers/mmc/core/queue.c | 2 +- drivers/nvme/host/pci.c | 10 +- drivers/nvme/host/rdma.c | 2 +- drivers/nvme/target/loop.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 | 4 +- drivers/scsi/scsi_transport_srp.c | 4 +- drivers/scsi/ufs/ufshcd.c | 6 +- include/linux/blk-mq.h | 14 -- include/linux/blkdev.h | 52 +++- 27 files changed, 367 insertions(+), 193 deletions(-)