From patchwork Tue Jan 24 19:55:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9535785 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 65350601D3 for ; Tue, 24 Jan 2017 19:56:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52A5F20700 for ; Tue, 24 Jan 2017 19:56:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45BC626E55; Tue, 24 Jan 2017 19:56:18 +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 7A88820700 for ; Tue, 24 Jan 2017 19:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750821AbdAXT4Q (ORCPT ); Tue, 24 Jan 2017 14:56:16 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:35113 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbdAXT4P (ORCPT ); Tue, 24 Jan 2017 14:56:15 -0500 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0OJt22r027710; Tue, 24 Jan 2017 11:56:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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=vbBRi2nagGo5OoOhk1TzXNwJwmTm8tEpKPwt0NSWqFc=; b=hxFwqTzPe21WEhBm0HUzSBV60rrV7UHCnEiVFufO8VWjMDBfZN2LeprMAQ9PtnfZStet EXRLq5AIQ+xi8YTyvUdNhi2RgIW1dJT/D07a9VWDvJvL+q9x8jaleJnwMJ9XMAZaxOIk b8jpXMcZv1/kqyYlfDsre3IPPny/ZMizO1k= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 286d38r3qj-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 24 Jan 2017 11:56:10 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.16) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 24 Jan 2017 11:56:09 -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=vbBRi2nagGo5OoOhk1TzXNwJwmTm8tEpKPwt0NSWqFc=; b=R9k/M8f6OQdLzzxAs/+QhyQM+t0mOenTRc9U8pnrSG8Ra5aTwXW7z3UuiGpH8iM/7l7oVYGa1IfT3XBngKK1HMWe2ZbrPT6f8HMhM1tWIJ/eK29dJ/RfOQrgxfiz2FLJIF5TPzdJHC/IH9g8KGJK7IzRgThq92hHd9UoFCcv3AI= Received: from [192.168.1.154] (216.160.245.98) by MWHPR15MB1197.namprd15.prod.outlook.com (10.175.2.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Tue, 24 Jan 2017 19:56:06 +0000 Subject: Re: [PATCH] queue stall with blk-mq-sched To: Hannes Reinecke References: <762cb508-1de0-93e2-5643-3fe946428eb5@fb.com> <8abc2430-e1fd-bece-ad52-c6d1d482c1e0@suse.de> CC: "linux-block@vger.kernel.org" , Omar Sandoval From: Jens Axboe Message-ID: <1663de5d-cdf7-a6ed-7539-c7d1f5e98f6c@fb.com> Date: Tue, 24 Jan 2017 12:55:59 -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: <8abc2430-e1fd-bece-ad52-c6d1d482c1e0@suse.de> X-Originating-IP: [216.160.245.98] X-ClientProxiedBy: BLUPR14CA0057.namprd14.prod.outlook.com (10.163.209.153) To MWHPR15MB1197.namprd15.prod.outlook.com (10.175.2.139) X-MS-Office365-Filtering-Correlation-Id: 435fd6c9-c580-4354-3880-08d444930970 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR15MB1197; X-Microsoft-Exchange-Diagnostics: 1; MWHPR15MB1197; 3:lnrs3zOUi3LdKj3I/mQVlArngW9PaJiUCxa7qqrNxJwMLPgJnqQCtQcKfUoxepDHlm9ZugQCmit/GncJiHNmrNCLJ7a+e956btFyI5jy2q/FHVyqCL0JTBqg4Acofw9KIx/LhUpR0k2Eeqm06kfo3Ev3XmvwA7Zg1JGO2FRHJWGjb3Aq7fTFJf4LL0Kwn3HNpKpBiBtGViLLsCirVr5yHUfFIKit3AeSfowXG26vlnlnRpYlA/uH6jaRiVPSHw6PvlE9Tn/4ORVgqXylYO6zPQ==; 25:wOJrNHngXDTEPa/OS4LQyvddV+7Ppe/LWJOpwqEAsV6IHe8yBisy1uhopIRbnbIxlXy5i7CDMcjkdSD04NtZVBbu4evSl1elx3nBkTPr19gJcyygTpclaDLe+7c8cDUNApvidvmH3swmWod3vv003IDbQZfTT9/R/gtEV7ggkBdPqylGNsETXrdGDr3+hWk94g5UZnW8AKPmUikfvYUeEbxgpPdlgE85XYyIPeySLYpOdihqTmFVWGRhnyf8x0sRFSn1ZuNxz74fAFBUragJpoIlx9FZS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Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148); SRVR:MWHPR15MB1197; BCL:0; PCL:0; RULEID:; SRVR:MWHPR15MB1197; X-Microsoft-Exchange-Diagnostics: 1; MWHPR15MB1197; 4:rsyK5fYvjqObZuUgSZggwipcEd69zsdHxdkir9S1FaViSjodUV8aYTkw7Xcv3+8Gn0CVxpT8+dKfPhfC7L+z7BHKRb17RhmwdZyMnBvpHd/ollop+qW6dCFLrsY3MEM33gy+R67Uj/QynzZHpxKIVAj1SGwLyD0WBrOSEZYEPZmKoeRC1J8UGnVXr0kprlDRXn6th4W4mSDBfMUNoRp9x4LjjK1svwOz/ctqplx7gfnoJ8381xd1hQF9/bddiCf9HlPVheAr07xbdZSF/YjioiCKndVKXe4YQ66ocr11RqDPX60f4dtF+WWv5RnIoxvyEdbosg+XWsMMTaUudCSfbrcLqs7DNcEaBJdTSiSoOafww06t/092kxad5VnJdEYS10/+EAzBBvjopT5sUKYFF8WetHSA67mJi7VRk6iq2nyhviGZ9EfDDNrTCOU82RgpEA4ySmlG3NOERz3FsxeQnkM0fkzW3Iu5IZGWfkGXpg7+fQtzT+4P1SlF2i9FcB4/2AzWSfm0SVQxDTIdlZl5ChOIIYarDxj9mF7OWPrLIk/Ls4T5KT9QG/dCPeuaCO/PHTq+F0QI2rpZm7d5em79uQ== X-Forefront-PRVS: 0197AFBD92 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(39830400002)(39410400002)(39450400003)(43544003)(199003)(24454002)(377454003)(189002)(6486002)(230700001)(53936002)(54906002)(229853002)(86362001)(31696002)(106356001)(50986999)(33646002)(77096006)(5890100001)(38730400001)(90366009)(54356999)(76176999)(105586002)(25786008)(101416001)(23676002)(66066001)(117156001)(230783001)(42186005)(81156014)(47776003)(6666003)(65956001)(36756003)(65806001)(83506001)(2950100002)(7736002)(31686004)(65826007)(8676002)(110136003)(6916009)(81166006)(2906002)(6116002)(5660300001)(92566002)(4326007)(3846002)(189998001)(50466002)(4001350100001)(305945005)(68736007)(64126003)(97736004); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR15MB1197; H:[192.168.1.154]; 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: =?utf-8?B?MTtNV0hQUjE1TUIxMTk3OzIzOjBIMUpCTXRCZ3cydXlUK3dkcFVyQ2NjL0E1?= =?utf-8?B?aytia1o4VDYycGJaYUdoZVdwdDVSL1ZaRGxIL040U1JRNE96WXgwcmVacjhM?= =?utf-8?B?TWxiZmpwRlQ1aTF0SzZNbEEzZzNrMDNYRGllT0xvTEJsMjFtTE1CaW8wWjI4?= =?utf-8?B?djgvVGJnNTBQTVhpbGxTMVVYR3h6ekdpUHVTS2t2eXcyNmdjWmVFeFlneGJT?= =?utf-8?B?TXdEWUlGRE1uRWYxb3k2ZU5NUjdDTGtPTEdsVWN2c0Ezc3h0d1VMaFFkRXRi?= =?utf-8?B?R2hGZjJEYkhhd3Y5eWl1MkJtb1RpNmduWlYrd284QmdCYnZyM3Npa0RKcFAw?= =?utf-8?B?QVpxaTluMGFLb2hRS1czeDgrTDRxanJ4U3BQTUJ2Y1V3OURNK0U3RDhvbmRC?= =?utf-8?B?S1FpbmJ5QitUTHhsMjVWanQ3VHNRZ0RzbmN0QXhLZU1qN0poMkc2T2k3TXAw?= =?utf-8?B?dEJDN3hvQVpRTmt0Y3FPVWVGVVIxSFJIOXBaNHVkcGNkV1VyYnBnaS9uTmxy?= =?utf-8?B?Ykdsd25udzRWZFdaUHp1dEtteXdidTA5a3AySmJ2RUxvTGQ2bk56MVMrb1U2?= =?utf-8?B?ckRDZExUU1Nsbk0wZ2pwbXRMcDdZamJIZz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X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2017 19:56:06.6696 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1197 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-24_14:, , 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 01/24/2017 11:49 AM, Hannes Reinecke wrote: > On 01/24/2017 05:09 PM, Jens Axboe wrote: >> On 01/24/2017 08:54 AM, Hannes Reinecke wrote: >>> Hi Jens, >>> >>> I'm trying to debug a queue stall with your blk-mq-sched branch; with my >>> latest mpt3sas patches fio stops basically directly after starting a >>> sequential read :-( >>> >>> I've debugged things and came up with the attached patch; we need to >>> restart waiters with blk_mq_tag_idle() after completing a tag. >>> We're already calling blk_mq_tag_busy() when fetching a tag, so I think >>> calling blk_mq_tag_idle() is required when retiring a tag. >> >> The patch isn't correct, the whole point of the un-idling is that it >> ISN'T happening for every request completion. Otherwise you throw >> away scalability. So a queue will go into active mode on the first >> request, and idle when it's been idle for a bit. The active count >> is used to divide up the tags. >> >> So I'm assuming we're missing a queue run somewhere when we fail >> getting a driver tag. The latter should only happen if the target >> has IO in flight already, and the restart marking should take care >> of it. Obviously there's a case where that is not true, since you >> are seeing stalls. >> > But what is the point in the 'blk_mq_tag_busy()' thingie then? > When will it be reset? > The only instances I've seen is that it'll be getting reset during > resize and teardown ... hence my patch. The point is to have some count of how many queues are busy "lately", which helps in dividing up the tags fairly. Hence we bump it as soon as the queue goes active, and drop it after some delay. That's working as expected. >>> However, even with the attached patch I'm seeing some queue stalls; >>> looks like they're related to the 'stonewall' statement in fio. >> >> I think you are heading down the wrong path. Your patch will cause >> the symptoms to be a bit different, but you'll still run into cases >> where we fail giving out the tag and then stall. >> > Hehe. > How did you know that? My crystal ball :-) > That's indeed what I'm seeing. > > Oh well, back to the drawing board... Try this patch. We only want to bump it for the driver tags, not the scheduler side. diff --git a/block/blk-mq.c b/block/blk-mq.c index ee69e5e..c905aa1 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -230,15 +230,15 @@ struct request *__blk_mq_alloc_request(struct blk_mq_alloc_data *data, rq = tags->static_rqs[tag]; - if (blk_mq_tag_busy(data->hctx)) { - rq->rq_flags = RQF_MQ_INFLIGHT; - atomic_inc(&data->hctx->nr_active); - } - if (data->flags & BLK_MQ_REQ_INTERNAL) { rq->tag = -1; rq->internal_tag = tag; } else { + if (blk_mq_tag_busy(data->hctx)) { + rq->rq_flags = RQF_MQ_INFLIGHT; + atomic_inc(&data->hctx->nr_active); + } + rq->tag = tag; rq->internal_tag = -1; } @@ -870,6 +870,10 @@ static bool blk_mq_get_driver_tag(struct request *rq, rq->tag = blk_mq_get_tag(&data); if (rq->tag >= 0) { data.hctx->tags->rqs[rq->tag] = rq; + if (blk_mq_tag_busy(data.hctx)) { + rq->rq_flags |= RQF_MQ_INFLIGHT; + atomic_inc(&data.hctx->nr_active); + } goto done; }