From patchwork Sat Dec 3 04:04:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9459525 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 1D25D6071C for ; Sat, 3 Dec 2016 04:04:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E2A928560 for ; Sat, 3 Dec 2016 04:04:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 031422856E; Sat, 3 Dec 2016 04:04:58 +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=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 1C5CC28560 for ; Sat, 3 Dec 2016 04:04:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754146AbcLCEE5 (ORCPT ); Fri, 2 Dec 2016 23:04:57 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:33922 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937AbcLCEE5 (ORCPT ); Fri, 2 Dec 2016 23:04:57 -0500 Received: by mail-pg0-f44.google.com with SMTP id x23so114481990pgx.1 for ; Fri, 02 Dec 2016 20:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=U5DrRhuR1xHS3u98mMo43uBZRDT3Hwg5wbDpkhv8rOo=; b=DWhdVeXWtaCcppXcZiIYgierezTpjZH5XcdKMDRm5vy2c/Ya4zxG8kbPPxjXhyCHM5 E8bYSPqyxWTb5sTDHD8IQJn1vaRvzFA1eJO3jR1R/nVntTuqVvSLIE9i7dWYKc2AeggD slLPZtlAE6G7mC1Z7Yoiaby42Ky1T/i+NFr+NYZ3okwCgabMUF97BQm0X2znELYUJTmb akb1o/pcHDBC0ItkEkQ62PuCYkfWaF3DGXQPog9F4Jvn0uG9qVRwcLXk5+pxluIUK5Eh XYklMNJQ9IRy4tXruOxX9QbrPCQBucdFH6AToI/VhIgJli4w6ZMiyDhfwGaD9f9YTRG9 C3xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=U5DrRhuR1xHS3u98mMo43uBZRDT3Hwg5wbDpkhv8rOo=; b=gln2AN80gBJYILYnZGxcmwWe5TSWDoFjlbfv1LshL0+LiGO3crK5oaRsYJU29pbnyp z0gc0ejnqNMtJGMRBTIk3zoiX+flSrhaht3oP2b3rJf5w9daqrlYclI4UsW5Xbe/ilyd 5zdmfWxq0m2nTU4zlfrSxqENmZ42LclGbWyFXvRkp243MCcOezOH2EynTJ9to31EZPZH 6qpDXKg3tPmeJX/cmIh0nH/W/ea6IKpNrTVN8dE1fR2b68eL18SDsvdFPJM6mvHB++jZ sDo7SnK7ki4ytUnbPIAaO/5avZN8DTWSpjB0m3WJnwzLEIlTpNv9fr3igUmZPNFNgzpw BZzQ== X-Gm-Message-State: AKaTC010cCJCEdO+U/dinDgBay1UMfxycUQboGOYaMvf+wNVsbW7zeHfUBp3F53zXBvHGA== X-Received: by 10.99.101.65 with SMTP id z62mr86089106pgb.74.1480737896245; Fri, 02 Dec 2016 20:04:56 -0800 (PST) Received: from [192.168.1.176] (66.29.164.166.static.utbb.net. [66.29.164.166]) by smtp.gmail.com with ESMTPSA id z9sm10816682pge.44.2016.12.02.20.04.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2016 20:04:55 -0800 (PST) Subject: Re: [PATCHSET/RFC] Make legacy IO schedulers work with blk-mq To: linux-block@vger.kernel.org References: <1480734921-23701-1-git-send-email-axboe@fb.com> Cc: paolo.valente@linaro.org From: Jens Axboe Message-ID: <7e29847f-93ab-2d2c-2740-7728088cf678@kernel.dk> Date: Fri, 2 Dec 2016 21:04:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: 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 On 12/02/2016 09:02 PM, Jens Axboe wrote: > On 12/02/2016 08:15 PM, Jens Axboe wrote: >> This is by no means done, but it seems to work well enough that >> I thought I'd send it out for others to take a look at and play >> with. >> >> Basically this allows blk-mq managed devices to run the legacy >> IO schedulers, unmodified. The only requirement is that the >> blk-mq device has to be single queue for now, though that >> limitation would be rather simple to lift. >> >> Since this is a debug patch, the default scheduler is deadline. >> You can switch that to the other configured schedulers, as you >> would with non-mq devices. Here's an example of a scsi-mq device >> that is running deadline, and being switched to CFQ online: >> >> root@leopard:~# cat /sys/block/sda/mq/0/tags >> nr_tags=31, reserved_tags=0, bits_per_word=4 >> nr_free=31, nr_reserved=0 >> active_queues=0 >> >> root@leopard:~# cat /sys/block/sda/queue/scheduler >> noop [deadline] cfq >> >> root@leopard:~# echo cfq > /sys/block/sda/queue/scheduler >> root@leopard:~# cat /sys/block/sda/queue/scheduler >> noop deadline [cfq] >> >> Testing welcome. There's certainly room for improvement here, so >> I'm mostly interested in grave performance issues or crashes, if any. >> >> Can also be viewed/fetched via git: >> >> git://git.kernel.dk/linux-block for-4.11/blk-mq-legacy-sched > > BTW, didn't include the patch for SCSI. You need the below to enable > scheduling on SCSI devices. Gah, that was reversed, time to put the computer away for the night. Below is correct. commit 8eea81e0903fcde1c28044ea66acc4c5c578f553 Author: Jens Axboe Date: Fri Dec 2 21:03:43 2016 -0700 scsi: enable IO scheduling for scsi-mq Signed-off-by: Jens Axboe diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 47a5c8783b89..aedcec30ee5f 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2121,7 +2121,7 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost) shost->tag_set.queue_depth = shost->can_queue; shost->tag_set.cmd_size = cmd_size; shost->tag_set.numa_node = NUMA_NO_NODE; - shost->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_SG_MERGE; + shost->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_SG_MERGE | BLK_MQ_F_SQ_SCHED; shost->tag_set.flags |= BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy); shost->tag_set.driver_data = shost;