Received: by 10.223.176.46 with SMTP id f43csp1249908wra; Fri, 19 Jan 2018 08:53:50 -0800 (PST) X-Google-Smtp-Source: ACJfBotP9Y2oAiYZe5sidX5vT+tWDtvpbjW4hu/x52EBgXKzBsMH5eKl4LtMCo+wgv9DVN+SF6ic X-Received: by 10.99.152.26 with SMTP id q26mr39939189pgd.74.1516380829929; Fri, 19 Jan 2018 08:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516380829; cv=none; d=google.com; s=arc-20160816; b=h62B/xA9wA2RkF1Tmo0cjJMSgsroE+saUT1eaHkgwDJAmbp5ZAFikGMp49erStu49z o5nOY1Tw/2wdkCbXd6JKDMwcYJnVCfZTQFPAcaSimFcB5YKdLPdVOYXZmrYi5R/ars2D WkkqPLXG5OkilcgIslov+42UypzD9dIbRumxZse4FV41g3HSJ5k90csBGF69z1TIc/MK 26GOwrGgRy2bTD10yBO2txxV57Z5yi+gUR6r1ykKzP712XM9a9tPbYJM0p4JoFibzT+O DVf4QPfDpqVQ6zoE3AGO0Y8lIsXwBAPUmNw7ceh3e3VOzdYS4GcgArTFju11ClPw6KRb VZOA== 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=jzMvKtLVejAYmFsdKAcmQVJLbuZxHgkhts/zESwuDxw=; b=ca7J0SlgjnHqoO99dv58pnlLuVR77PSThLpQxessWjx+mGYlCM7hc6q8e7galn4dGp K3m337VuqQP6TR1ZRbMsPHhcQGKSpTW3UKB1F5pEUSTCyxXeKFg2AB9unHGf4WbELJnQ dcuL+shxQwsWXL0AEVeYCfp7VBkaWVE+yq8zHPgrc4tIDBEXYTBniPU9XhIFC9NOKBqn E5PvVS1kTgaNMnJd0IbnsMd+OvFPp4yOddQc/wVW9gs8dwPzpY3WkQSGIjfCJpffWQCs 53xjupKH4F9cLBYHvDP7fitQpE/+HYvkqNaPnXwqN3uaWsxDtUDvI/BLnyW2EyO3z68I QPnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=IiCRdvXZ; 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 k1-v6si947176plt.459.2018.01.19.08.53.35; Fri, 19 Jan 2018 08:53:49 -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=IiCRdvXZ; 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 S1756080AbeASQwn (ORCPT + 99 others); Fri, 19 Jan 2018 11:52:43 -0500 Received: from mail-it0-f49.google.com ([209.85.214.49]:36146 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755965AbeASQwh (ORCPT ); Fri, 19 Jan 2018 11:52:37 -0500 Received: by mail-it0-f49.google.com with SMTP id p124so2838339ite.1 for ; Fri, 19 Jan 2018 08:52:36 -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=jzMvKtLVejAYmFsdKAcmQVJLbuZxHgkhts/zESwuDxw=; b=IiCRdvXZ95AzlLXoPTKNcoTbI4QR/Vk0oEhxGnGg7VmbHE6QHR8DUhZyqGtxvX0XBZ kPn9jv7sxJswVTeCRrc0/TNxYKNtMCG07gttSKdJ1skkbmnAxkxeKfxtYb6VX5WoMEFN loMVlTBhoxcY3PUMkIdpR7E5hAEhmwDkz/X4pj5gGJO7ZkP/bzgxkY2JrxDK+2fff5Kq f0EQ4M2o2pMEsyP/54FuY1RnOisJ1tMfwNTb7aEe5NIvqQCPQFwMKgZbt4AlES3C2atJ tAPhQWrDA9rD9m+ISNQfK5sGtwYnjQmBwX102rIS/2gwYrEJdHmhpd59LnzPIAbPiyVH C2PQ== 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=jzMvKtLVejAYmFsdKAcmQVJLbuZxHgkhts/zESwuDxw=; b=ewWhrSEDelLa6gEDW4ICZU3UNLkKMxxIDJHMZO6qO+ofBbd+8sWeJ26eYtTvWZElg+ V06MjmwQpdY1LqyIA2jHyIVwPKyYT5X2b2JbaEeIgQ5lYrXbCHAlFBPG9cHOx6+rVIMu R8CTdxMHVKybdLeBweAJdqphqpvKErnyjDRavStoqxca7GTZ/VBz6oqXJvrvKEMtIbbq p3Edi1a+NkxBlt/UCPgFhrb54N8Nt+U5buvt626Xh7ILp629W8CvxuWlmXEhbpbGcnlt vo9i64FAjUiL3DoqPJdNZn0gkJ8eLycywW056oO7vUkzyoLrFAlDQ0cpDjJ65FQdYfyn y5Wg== X-Gm-Message-State: AKwxytd2IgJveJliOFsNsa0VZQjrT2BkRwPiUKCvMuhmL9WstWmmmpuL PM9fdBWlAsgCTOw/FgVezxgOEw== X-Received: by 10.36.47.5 with SMTP id j5mr24200157itj.123.1516380755274; Fri, 19 Jan 2018 08:52:35 -0800 (PST) Received: from [192.168.1.154] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id o8sm4376402ioe.56.2018.01.19.08.52.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 08:52:34 -0800 (PST) Subject: Re: [RFC PATCH] blk-mq: fixup RESTART when queue becomes idle To: Mike Snitzer Cc: Ming Lei , Bart Van Assche , "dm-devel@redhat.com" , "hch@infradead.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "osandov@fb.com" References: <20180119072623.GB25369@ming.t460p> <047f68ec-f51b-190f-2f89-f413325c2540@kernel.dk> <20180119154047.GB14827@ming.t460p> <540e1239-c415-766b-d4ff-bb0b7f3517a7@kernel.dk> <20180119160518.GC14827@ming.t460p> <4a5c049f-0fab-bbaf-bfe2-eb5bca73f2c8@kernel.dk> <20180119162618.GD14827@ming.t460p> <1f072086-533e-4b75-d0e3-9e621b2120d8@kernel.dk> <20180119163736.GE14827@ming.t460p> <26833249-cadf-ba9c-1128-0bcb70ceb9e1@kernel.dk> <20180119164722.GA29449@redhat.com> From: Jens Axboe Message-ID: Date: Fri, 19 Jan 2018 09:52:32 -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: <20180119164722.GA29449@redhat.com> 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 1/19/18 9:47 AM, Mike Snitzer wrote: > On Fri, Jan 19 2018 at 11:41am -0500, > Jens Axboe wrote: > >> On 1/19/18 9:37 AM, Ming Lei wrote: >>> On Fri, Jan 19, 2018 at 09:27:46AM -0700, Jens Axboe wrote: >>>> On 1/19/18 9:26 AM, Ming Lei wrote: >>>>> On Fri, Jan 19, 2018 at 09:19:24AM -0700, Jens Axboe wrote: >>>> >>>> There are no pending requests for this case, nothing to restart the >>>> queue. When you fail that blk_get_request(), you are idle, nothing >>>> is pending. >>> >>> I think we needn't worry about that, once a device is attached to >>> dm-rq, it can't be mounted any more, and usually user don't use the device >>> directly and by dm-mpath at the same time. >> >> Even if it doesn't happen for a normal dm setup, it is a case that >> needs to be handled. The request allocation is just one example of >> a wider scope resource that can be unavailable. If the driver returns >> NO_DEV_RESOURCE (or whatever name), it will be a possibility that >> the device itself is currently idle. > > How would a driver's resources be exhausted yet the device is idle (so > as not to be able to benefit from RESTART)? I've outlined a number of these examples already. Another case might be: 1) Device is idle 2) Device gets request 3) Device attempts to DMA map 4) DMA map fails because the IOMMU is out of space (nic is using it all) 5) Device returns STS_RESOURCE 6) Queue is marked as needing a restart All's well, except there is no IO on this device that will notice the restart bit and retry the operation. Replace IOMMU failure with any other resource that the driver might need for an IO, which isn't tied to a device specific resource. blk_get_request() on dm is an example, as is any allocation failure occurring in the queue IO path for the driver. -- Jens Axboe