From patchwork Sat Dec 3 04:02:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9459523 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 1C0E46071C for ; Sat, 3 Dec 2016 04:03:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 017B028550 for ; Sat, 3 Dec 2016 04:03:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9CC628564; Sat, 3 Dec 2016 04:03:02 +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 549B628550 for ; Sat, 3 Dec 2016 04:03:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752104AbcLCEDB (ORCPT ); Fri, 2 Dec 2016 23:03:01 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:55694 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937AbcLCEC7 (ORCPT ); Fri, 2 Dec 2016 23:02:59 -0500 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uB340B45018008; Fri, 2 Dec 2016 20:02:58 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=2L+mu/r4tngWqAU5sNJwGmV1LbiQkSEzKQ1LwwVLlmk=; b=YdocmqC+EieWa//6McT5eArfajGoxfsYI0D+ulPsjpzLipDUU0i1oB+lFRJGJlDKCOpr 7FYcKx+AiWXi7uigMVvNdH0vibfcxwqLZmG7A4dUjuitIFqokzf07kjPaARmjhcQ3X9T 0C4rD6un1P5TdKihxxpqPFLKJlbBG2Crmdk= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 273g0ctvhd-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 02 Dec 2016 20:02:58 -0800 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.18) with Microsoft SMTP Server (TLS) id 14.3.294.0; Fri, 2 Dec 2016 20:02:57 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Wi1f/LAQFzUzm7BIQ5HkKzM3ZxNYK8kn25CxNae7vJ8=; b=g5LY/t+6WZH++dw6QIg+zuPQMjzbbSpxlV5Am8fqvQjR3kN5WDqzK/ajjVtPf8dkoJJlMxqjU7/uGTGnezv5f7w9LBOQNh4iYD1HY15j3AidTzmpWybjMu27Q+hRiRqEZe+Ghd2i9Tj1b9Ayu8t3ds67ufSV8MqAXT8PDGPk+L8= Received: from [192.168.1.176] (66.29.164.166) by BN6PR15MB1185.namprd15.prod.outlook.com (10.172.205.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8; Sat, 3 Dec 2016 04:02:39 +0000 Subject: Re: [PATCHSET/RFC] Make legacy IO schedulers work with blk-mq To: References: <1480734921-23701-1-git-send-email-axboe@fb.com> CC: From: Jens Axboe Message-ID: Date: Fri, 2 Dec 2016 21:02:33 -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: <1480734921-23701-1-git-send-email-axboe@fb.com> X-Originating-IP: [66.29.164.166] X-ClientProxiedBy: BLUPR17CA0032.namprd17.prod.outlook.com (10.164.14.170) To BN6PR15MB1185.namprd15.prod.outlook.com (10.172.205.139) X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1185; 2:HDJAsJpNGyZT1mOnnTQUrpr2phubHUVhZ3g63vQs+CecGtADfXGVk7MmXVldUfYKH0nmCeRTr3kCwiISj1OzuzM+9Me6RBb0ZncGh5wBe4YQwKwsTKl2VZ4ERndV9mxvEBDT2lz8AIOjaVHwQH87P7wiP34aSNwqNIQ7/KjJ6VU=; 3:evAWpe4iFY/lI/2vuBnkUah0Ezj4w37oF8jx7+Zxa/7YqmlTlBTAm9Dd/Cyw24g/kUZjccgQz0McUm9xuhLll6DdAg7Hl8fa3/+yrNEadFvjJHNCixBKow/rZIdI0pB7sm9I+zhZCV/neOyeEe+NUfxAHxWjZyGuF26CFybtcAA=; 25:8yW9xUnODtu4LtetIpKP6OvvSTE3rl2gunZrO/mwgTLjmWfSf3o2WY1FK5uw42NS8N71HeMliA5NPNWuvseHQhkwx028Nfaenl9ovu0fa3Iw8+s961cwS9/c5r5umcHo2zhzzr3zsF6iYkmuBcI6Tn3P68e2DSrpu+DGmSSnv+RUCKEPLgGqd3ps89gMprUybmZq4xVsJMdqcGkEQ4O+LSKOgIkuv19NDuQ4ZUs9Ar4dwwsy+hYsPacVuZerHlWEnzK1Ymws3asuB0sgBL/byDduq+ZqbSSXH0TsTzSFbfySzaI6/I7XJLU8XgHJXggN8S5lx97+IoDY1DzCQxD94frCT39GZxus83uTyWuEREXsuuH25UD7mquxbc74xkvG9Jxj2qVVdLJvR+0gR5lS/At4wvyEsSfZ63iXmXwSM40jIER+QYVgIfURXeLRbSmYsI2azLjmhpLTbfo4Spkumw== X-MS-Office365-Filtering-Correlation-Id: efda84f8-af98-4126-31ca-08d41b3139d0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR15MB1185; X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1185; 31:ez9b4I6Jt2lLrwhd1Ipx+BG8gwCe2S3zRVj5ssiBxXleJTRn0WZCdmVaxMCAuueqEe5Vbux5YEZGRQjFRN/Ew4tVqBnL8c1vCrUUMNQWKq3XZTSIBTeAZ3IsjenbpII0pE9B26VUbidirYyt8njVW71M1tUjvTohEeyefiph6pcO273rmPbTTL6W/sIeg2ev+OWNCk8RfHVD9UFXUEJD1KYbPcxTG3YioocmMPgzU72rDvC/ObLaIl+NMLRzvuZxHJGw1lLkPOmvzduvBx0fMg5y5VS03hHF04DwWT7qKPE=; 20:brO4bs3I/rLLwimgxqeafIVx/Rv+91hR9uiTpE8mTeLCMEUY4+vyvroaYoSwg5NpWwXh4151BUm7aWgFeHxxKbHr6JoqtNH2sgn5hOq038e5cu0VXpJz6V1q0/DOHsELy3Hl4aduuT0obduzGZim/dCJsYm58BE6vtyePNKSUvFRx0Nwz4Ggsp/ezN7QBaR2o207LEUMI1L8Zmle+BbVGnfAh6NCxmD1OyB0rsTMWe8capjNpC4Rvf6hBZFz+LMQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(6072148); SRVR:BN6PR15MB1185; BCL:0; PCL:0; RULEID:; SRVR:BN6PR15MB1185; X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1185; 4:Ecd+ozhrTfkiM8w+dg5cRjYiljpY4CVrEfu5joaBuea9cBpulBtzLdGY4Xsorp66BVWWtWcZfT+Y435u9fYHbJ8AgxNYhzI+KuW9ndHf9MnMAeZaSdYg8AbD7/H/oGsiRdxaBU5bEtjCTqcx9X4/fGURcbnt+pzDqmTRGARYyjqUaue2yTpW4TbuV0+54shuqmX4zWGbzV4qcG/hAUtup5gTtzP8yNJsOaVceheFjBJ9n9zlip9XheghLj2/q1qHGhIRuNGzW94YmyIAxpVXBL+hdhai09x0OGCv7+9VNYjV+g9dhl38WeAYwmoJXI2lA3GbyKpaI51f74ydsx7+cwug6LnTgszDwwMxHbcQAL1FpRi8nBlfzxJBjkm70/dYTVIL6i7B/Akds1faOaofDHu5B3LAsw+V9ujvDrAbTS8sFysP64wniKWMlyxilMOQukUCODftvlU4Q1//NC6QYxTeM1jl3FyBW17/kgE/6ZwgbvZFJGJckn7jXfyNqoBNsS+84H+1evi2mL7gCZm2005wyBxgBjKhuZF/vBHNDR9++olGvIPn4EbKvHNAdWIA9iWMxMuQdMAGOzLGuj8/lozGtG5ePmsy5EHgvh6UiMEw7w344k5JxKK5cfCx0yUO X-Forefront-PRVS: 0145758B1D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(199003)(377454003)(24454002)(189002)(117156001)(2351001)(5660300001)(65956001)(65806001)(66066001)(33646002)(305945005)(81156014)(81166006)(7736002)(7846002)(77096006)(31696002)(83506001)(4326007)(68736007)(86362001)(2906002)(230700001)(39450400002)(64126003)(97736004)(39410400001)(3846002)(6116002)(110136003)(4001350100001)(47776003)(101416001)(92566002)(23746002)(8676002)(189998001)(65826007)(38730400001)(6666003)(2950100002)(6916009)(50466002)(90366009)(6486002)(733004)(106356001)(229853002)(36756003)(105586002)(42186005)(76176999)(54356999)(50986999)(31686004); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR15MB1185; H:[192.168.1.176]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BN6PR15MB1185; 23:EngbZiTbxgZ+pk+Hp8A3MBP2wlsdQQNonXzpG?= =?Windows-1252?Q?CR9eucazHA2y1y/Ux+5ZHfg592ur19ojHFqvuQxLqKH617brBjPcZ3X9?= =?Windows-1252?Q?WZ9Ub1QaLZYliejWmeSAt9IzGiqDtR+uPz/22Opg3guf8p09YAu7xuOu?= =?Windows-1252?Q?5xcJhpeE4GYPUYWbAAXjjrVRCw9cNWlEous0U12se1JhWo5hKxLJUYRp?= =?Windows-1252?Q?3ESk7Lg6f04m/MyphCGCwucGfG9/JTmILwlqglo1lt4qNWmIkCZ8eDz3?= =?Windows-1252?Q?iZLAYQP3oV8pvTUku49qIJczq0kMQp7J84DKQyXm427aEE3F4vIMkFND?= =?Windows-1252?Q?vtPEDHn/rFDJ8SkZfViNGi+HwWO+ZfonRumtYfKgO5td6rLBR1gi1Eqk?= =?Windows-1252?Q?1tWGhjDtSxjNI7rCS6mgh9DVk3CE6P6kOgoy7h5POBF/9A1z8udzb8Pi?= =?Windows-1252?Q?IM4K/jyQvVI+u4GZU2AEBzXmny1iGK+rEPlezza3yl4QMCtasdxB2/87?= =?Windows-1252?Q?drmqnPIrwTfuDvpOksigkIq7XJpjAV/+DFBMytI500888EF+mdSjDxi0?= =?Windows-1252?Q?lc3+oWma0kkSYvNW+y2Vp8uOdup/Cyg0S9treT7pkahuYjIbxwdz0/jw?= =?Windows-1252?Q?kDKpJXhpe4Z/1JOJwK7V6gk1RXUM+r/GiHRJZsmUAMQPIrQwLPOZ09ZS?= =?Windows-1252?Q?8y8n2tNmg39e6ALo58QxEElyS0Q3Hv4gDg3xfTG4LwoTUBa7psAvbJs2?= =?Windows-1252?Q?IGUA0vW6BVOa5jc0VPAtf4OILLYRHMFObDUKDwmbXxwnVIR64FfXH7fg?= =?Windows-1252?Q?XUUcbmriGGq53RjNnBl5vV0frIIDacziDuH42e7A2Qp0xCkT2C5zmIUZ?= =?Windows-1252?Q?SRpglHFvK005SrVtG3k2Pr9L3XBAuJ56ROkFaFUBzPDR8U7kLpO41+21?= =?Windows-1252?Q?/HCoW/MPvlIU/ExrZuhL2T5IsojxDo3vvBs+orfKzQcrwEWJly2xP51A?= =?Windows-1252?Q?MZTItensunfZpM9dtUegRKJCGthfJeM4yjp8HSQlz4TebxXGruFRpZfw?= =?Windows-1252?Q?6YeOewftyqt4KYDk8xqS255NLaDeCDmt/g6m/sj42ZCpOSIYbVl9FEYt?= =?Windows-1252?Q?qAgct6w8VIgZ5vLox+AYtcF9BIcXyYTNzzwIt95CNtEGql+t53O7KPyb?= =?Windows-1252?Q?pqkfH3f2D0+2FhXCrCyF1OsPAqjPFEpkU1ordlo1WJDiCxMReSutnTHz?= =?Windows-1252?Q?CKp8IbosUwuHUv1HqjrAfTwZOy4zvTOIdAcMam/yt+NwybcAh7huHF80?= =?Windows-1252?Q?OjEVrsPtSiSKgNR0WtSv5U1k2/xA+TLJ3Toy4DREQTbLi3srXwoA5UTb?= =?Windows-1252?Q?FOElm5tEsQjwrC/8jTEn876rX4RsTSHoBesXS2fV0g4ome+wTcsl1osO?= =?Windows-1252?Q?Z87AMUof4jZlyBxGitgswFnwdyz4aDmd6UtFhiArU7ldDNAsbSI5w2T5?= =?Windows-1252?Q?E0I2hhjZKZXBlgpafBogKICbl1tjBhDkm/Xyl8dHM/dHOkyv/EruuVUO?= =?Windows-1252?Q?nM0w5MBJjorpaoQVALG5WA1aCCTPc8UKDVg?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1185; 6:t9hh+UPxlBiez8wkMMwJFkd64VSkV6B8vZBk15sRcw2UVjvRhnQoAEVQS/tApCf87CYzlUviSsxk1tsa6T+aj9PYCe0j+RfhBf9l5FDjOZleW1M3yH/MRn4lmwH+CQXmnwTTtGcerknuahrPlo0LTzzv2fIAfDZCFxGSmBzjeL2G1Tk+baS3amu5ZrFd2mPm2wU8vA6aQjGZ2v2+ZG2g2/pJ2ZQpxCxByHzxddv0eDPF3Gpu8JJQ2zDL4yNxzl1a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CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1185 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-03_03:, , signatures=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 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. diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index aedcec3..47a5c87 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 | BLK_MQ_F_SQ_SCHED; + shost->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_SG_MERGE; shost->tag_set.flags |= BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy); shost->tag_set.driver_data = shost;