Received: by 10.223.176.5 with SMTP id f5csp1184736wra; Wed, 7 Feb 2018 14:19:18 -0800 (PST) X-Google-Smtp-Source: AH8x227QUzeZEWCz31OdnrXLEvRaikTxR39X++Jux8ZVOY6af7plRxQHUpc7aOoXLTB5Qp4xq0cx X-Received: by 2002:a17:902:9898:: with SMTP id s24-v6mr7595802plp.275.1518041958808; Wed, 07 Feb 2018 14:19:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518041958; cv=none; d=google.com; s=arc-20160816; b=bzNYgWUTMfjqeA3CWL1mXXHOy94wlzNWsEfD24P79u6YMtKMmvP8EndzinMDLXckbZ 09vxD7a5tCbXgMWL11DEElcDAfnE07Iu46wWxXSlytN/0Dvqg+Y7P+H725ljbZryb8Kc O07yeD2I1II71jcUbFcNsMiu82BYRd2W9J7B6rxs+yZANHcVxkdL5YoiuQmTm35p6Z9j ClYsvQVA+rIoLISbGxTl6iRdelAhO2EWCpyBIbgW8+saYPnctCbzhtIOe0447JXtsxfe RRGpEEgAi/LzSPAgs99GAgLdKQVR3L0ZkM1kOBsT29wMjTcOkXGY2RRgFeHY3eqk1zg1 PElA== 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=9sloCdJkrau7N0PhLa0Zwc9CiD8SMhyxtzW4ctATor4=; b=rK59l5AM9v03qhzplfzHNRx2z55oMpUI8UY49dO8NRF1avbXVfwFFz1B6tTg22WnYV /Q+wPLwAOVMN2IeTbtsEYP8kWkZGOkZJlQHivZ0sf4zhd5Z8R7sAFZvsuJx2O6ErY6TG IzCwkHGIJOxGUMy2DPnii18+jmVCAFp/TY1CUgVQmNZLkccMPoLkP9BYp7ia3+nlA3/s o07ckAlTjxYRuOx56/9TpchmS32af60yNgh5LpFbRwXhECZTS3Ka2zkDV35AFgfUOTMF l6RBr1bM8tNQjuvTtoZSWx5vxa6s+CJJ1oqe4DKzkHx43U30Ke6zoTJLKuwuSZFIr4qK 9r5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=xnknW+lB; 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 m11-v6si352197pls.19.2018.02.07.14.19.04; Wed, 07 Feb 2018 14:19:18 -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=xnknW+lB; 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 S1750984AbeBGWSW (ORCPT + 99 others); Wed, 7 Feb 2018 17:18:22 -0500 Received: from mail-io0-f178.google.com ([209.85.223.178]:34778 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbeBGWSU (ORCPT ); Wed, 7 Feb 2018 17:18:20 -0500 Received: by mail-io0-f178.google.com with SMTP id c17so3709137iod.1 for ; Wed, 07 Feb 2018 14:18:20 -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=9sloCdJkrau7N0PhLa0Zwc9CiD8SMhyxtzW4ctATor4=; b=xnknW+lB7korGpEAWfQSgcNN4qkcG7mtgZD3dWOZ1ZP9SKyAK61QaorDVMZEKdjgAl ZaIhEJrR9nZZfydEgCXOc9ub+fX3s6NMgtWSNYW5D5Ga0yxhximN5ctWsm2fh7UkC5xJ 7MydJF/GJJPTmAGGxdI23rk4kY7jMt9A2YqnVNTsXUSI8XnOi3eNRIQPmcp2DPxYT9sO PLtkhRWAnxZ9Ouq51U8fzw8FyJziwDFZhouJRcLR767uGEk/u8A5GcuBzVQFAJrG77cg nndCiyQcxoDH/gXkW1+OqbzFJ1STiAIie6RoLs+6xy36lT83KR1qB8//v5qBVEW+sfM8 E8Hw== 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=9sloCdJkrau7N0PhLa0Zwc9CiD8SMhyxtzW4ctATor4=; b=pbtjDpp6Nhe2/PwTzNH+9J8dvipMcSrBk0Ef+K/oFjcvxCZxiyZSrl0Pw+wfHIlk15 sQR22Td5LcL21vXVRYaQQtvBo8n9o4gLhQXrGUW6/l8spNAv1er7T+PrpovHmWIMvH+4 C5STqjMJmVzr4fu6u4s6/TvoGNGJVEnQiOlEuB3xvE4uxnHVaqmy/FWRWMrZ93ghE9mM SLqXFyZAEAutxA6UxU7nFUSVeAIh4UvIOMCnLU+V54sSjp+GIxWGMmT0z4CceHwqOTTd aXD7oRhbneg6RcBLPk6lgJX+YX3IKYNHkL1zgb0rRr9lkrARAOZ8ghUlZxeE3LBzIdp8 0gQw== X-Gm-Message-State: APf1xPBJBu7U1RCqqRPm+VSn/muZDjzrTnRNSpRnFQSygO10SKZ06HOB o5a4fMA3jiaktxbXsr1Ce3jm9A== X-Received: by 10.107.160.21 with SMTP id j21mr4758427ioe.186.1518041900270; Wed, 07 Feb 2018 14:18:20 -0800 (PST) Received: from [192.168.1.160] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id j130sm2770967ita.33.2018.02.07.14.18.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 14:18:18 -0800 (PST) Subject: Re: [PATCH BUGFIX V3] block, bfq: add requeue-request hook To: Paolo Valente Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, broonie@kernel.org, linus.walleij@linaro.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, alban.browaeys@gmail.com, ming.lei@redhat.com, ivan@ludios.org, 169364@studenti.unimore.it, holger@applied-asynchrony.com, efault@gmx.de, Serena Ziviani References: <20180207211920.6343-1-paolo.valente@linaro.org> From: Jens Axboe Message-ID: <17c57205-7cc0-5577-0322-dc35914e50e5@kernel.dk> Date: Wed, 7 Feb 2018 15:18:16 -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: <20180207211920.6343-1-paolo.valente@linaro.org> 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/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. -- Jens Axboe