Received: by 10.223.176.5 with SMTP id f5csp921777wra; Fri, 9 Feb 2018 09:20:13 -0800 (PST) X-Google-Smtp-Source: AH8x224h2pS0rLWLauh1bhONVM5LLNvSCLskw8zKkbaKojn26Uvf4zVGhyJtVQuUUw7gbNay0pzy X-Received: by 2002:a17:902:5305:: with SMTP id b5-v6mr3145323pli.61.1518196813384; Fri, 09 Feb 2018 09:20:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518196813; cv=none; d=google.com; s=arc-20160816; b=jFHBvfbWx0w0zi0r1DnB8V6KbG6FGjKJrt633Dc5eKTcdqTuJih4deUDwUY/TslFBw dCROX8APgs30oh9hgBbQ3o1LQ84ju2rEBFbPkk9pJdMXDhvyy1Gd94N2dpV3B8KMiW6R DmBMUCvU4NV83lEKhT/Z6B+shytfYj0QpRn2n53NNfEs85rC8TJO9yxPL+TyDFZBTDbe y7ybsbVLs1+DxSgj2/QYnJujePwkfObp2fGT3SiPisfLcMS2KbOQ0Q7PwMtdQj8PzdaN voYkzklQ6vMJTNxg+2zQT1PTq6fqIhRk3EfHKGRZMxmwfXT47n38aabDJJq6mKKbtqc2 OCrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=444O8+ICApcYbtEv6UBfiiR3ywI6Yh4/R5mK/9iXOpc=; b=kMOKZuKAqWYdrNUl+D85mLuxfw4Cu9Pqd7PReBVnzNekNXIqj2JGfgl01bkJp5SjRI 2REVX1rtMbVvqlgmmPhHK41slBUKeiUVjgACN/vI0EdfPRYgtzb0UqhH9UKSqGfMkFl5 5gtmczUHWxXYqS++NTR45uz74Mg4wJA4jhi0Vr/vZb4koLdE3d6JmSiqwmXTWtEnycRB rodWkR3vtZ+O/GHr2FEARSd4j4ItjhmG0EYJ1FWWT25bIQWqzoCoqQk2lBat1IMb4Z39 KlLqkoj9NwYqdrWnQhjko+/HtHBIvUgSf8wm0OhcpugHIT4l/y5bNaV9apy7qjcfwpup fbzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=BDc8xLEI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 201si94460pfu.37.2018.02.09.09.19.59; Fri, 09 Feb 2018 09:20:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=BDc8xLEI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752403AbeBIRRk (ORCPT + 99 others); Fri, 9 Feb 2018 12:17:40 -0500 Received: from mail-io0-f169.google.com ([209.85.223.169]:46098 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbeBIRRi (ORCPT ); Fri, 9 Feb 2018 12:17:38 -0500 Received: by mail-io0-f169.google.com with SMTP id f34so10393600ioi.13 for ; Fri, 09 Feb 2018 09:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=444O8+ICApcYbtEv6UBfiiR3ywI6Yh4/R5mK/9iXOpc=; b=BDc8xLEI6KMRoVnBBWJOfBvm6H2Xp1R6yF+DDoEKDls43n1tg8uRlU3dnvZLtlUbpg z36eeXFNJ9Ev9pl9UQbkQCvk575sWqF/tdUTSFmsRYoXuQhprC/4OOB7DN11hU5ubLkF Xu5mpfN7wR8kS7Q1Agc2JtO+K1nIwCNyvHA/mCuaucyxYGNPg0hosXgTGHb9gk70iOZq 3vNRasGc2rgqVbJ1iEAjlDanXawjinrsH2WpqGaX9s09PYA05P9FpErJKacxErkVhhvF g+wC1Nu+KlURZIBgSyPTTy+UTw7EOgc6EsdVD1egzp16x1XyqJ5oxTEn8DGlpne4BG8I MEUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=444O8+ICApcYbtEv6UBfiiR3ywI6Yh4/R5mK/9iXOpc=; b=Ik45z18R9bi4qjGuYAFqoJYgyUZIGcJtR4SPY2CG2CooSNhcHhqUDO72jQPmUpnEov GTYYqDovW4RKeOTrcpuT0oRt7oWXqE9NRogv1FTZliAm5tMk+aVry3eZRGUH7w0SrKuy W1En0/x12RoyMPgbjqLrAlC/DfGYFtb9V16Cfy7D8lwq7Ec2/6n4Lv/TuBUyJqgA735x vBTu9B/5KK8oUSFK+9TztQ9MydVWMtOQzO/DpgdkME3xzW6d5bDGVCBBDT2qDP6mX3r+ Hn9/UQD7zLiszefVyIR3sBqZoyh/B0l0mLN1CPU+Bk3uFe08ipqp8XP4FklD6bTaz2dN Qkag== X-Gm-Message-State: APf1xPBC9tUJc9Sr8bEDVppNMTnosGAW5gnTH5KjvvMGsA6+DR6ODlEq Z2PYi7rYNoMdR6T+XLoj6OxlbA== X-Received: by 10.107.174.223 with SMTP id n92mr4143255ioo.305.1518196657831; Fri, 09 Feb 2018 09:17:37 -0800 (PST) Received: from [192.168.1.154] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id c143sm141651itb.23.2018.02.09.09.17.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 09:17:36 -0800 (PST) Subject: Re: [PATCH BUGFIX V3] block, bfq: add requeue-request hook To: Oleksandr Natalenko , Paolo Valente Cc: linux-block , Linux Kernel Mailing List , Ulf Hansson , Mark Brown , Linus Walleij , 'Paolo Valente' via bfq-iosched , Alban Browaeys , Ming Lei , Ivan Kozik , 169364@studenti.unimore.it, holger@applied-asynchrony.com, efault@gmx.de, Serena Ziviani References: <20180207211920.6343-1-paolo.valente@linaro.org> <17c57205-7cc0-5577-0322-dc35914e50e5@kernel.dk> <34041F0A-F460-4736-9A6C-76D861EA0070@linaro.org> From: Jens Axboe Message-ID: <760ae85e-be4c-cf13-53f2-579ab4646b09@kernel.dk> Date: Fri, 9 Feb 2018 10:17:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Thunderbird/58.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/9/18 6:21 AM, Oleksandr Natalenko wrote: > Hi. > > 08.02.2018 08:16, Paolo Valente wrote: >>> Il giorno 07 feb 2018, alle ore 23:18, Jens Axboe ha >>> scritto: >>> >>> On 2/7/18 2:19 PM, Paolo Valente wrote: >>>> Commit 'a6a252e64914 ("blk-mq-sched: decide how to handle flush rq >>>> via >>>> RQF_FLUSH_SEQ")' makes all non-flush re-prepared requests for a >>>> device >>>> be re-inserted into the active I/O scheduler for that device. As a >>>> consequence, I/O schedulers may get the same request inserted again, >>>> even several times, without a finish_request invoked on that request >>>> before each re-insertion. >>>> >>>> This fact is the cause of the failure reported in [1]. For an I/O >>>> scheduler, every re-insertion of the same re-prepared request is >>>> equivalent to the insertion of a new request. For schedulers like >>>> mq-deadline or kyber, this fact causes no harm. In contrast, it >>>> confuses a stateful scheduler like BFQ, which keeps state for an I/O >>>> request, until the finish_request hook is invoked on the request. In >>>> particular, BFQ may get stuck, waiting forever for the number of >>>> request dispatches, of the same request, to be balanced by an equal >>>> number of request completions (while there will be one completion for >>>> that request). In this state, BFQ may refuse to serve I/O requests >>>> from other bfq_queues. The hang reported in [1] then follows. >>>> >>>> However, the above re-prepared requests undergo a requeue, thus the >>>> requeue_request hook of the active elevator is invoked for these >>>> requests, if set. This commit then addresses the above issue by >>>> properly implementing the hook requeue_request in BFQ. >>> >>> Thanks, applied. >>> >> >> I Jens, >> I forgot to add >> Tested-by: Oleksandr Natalenko >> in the patch. >> >> Is it still possible to add it? >> > > In addition to this I think it should be worth considering CC'ing Greg > to pull this fix into 4.15 stable tree. I can't add the tested-by anymore, but it's easy enough to target for stable after-the-fact. -- Jens Axboe