Received: by 10.223.176.46 with SMTP id f43csp1269283wra; Fri, 19 Jan 2018 09:07:29 -0800 (PST) X-Google-Smtp-Source: ACJfBouBejIC+jztS1OYmEyzVHm0FaFdN+dJE4PZIIuatYHU6X+Wv/k3u3HpU4WF1UaD9fcxhg97 X-Received: by 10.99.38.6 with SMTP id m6mr42020352pgm.12.1516381648899; Fri, 19 Jan 2018 09:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516381648; cv=none; d=google.com; s=arc-20160816; b=gkwzif9S+QjNYKtnhszZ/La7McBVMu2Q7fGf1Ise917Sq3UqPrhBwMN9ODLlrnUmDp gE/+TGGYuXF0pH7eDpOwEPDbIjAN7eDk/54gbENT6MhnPl8gL32Nk6gGI+GTM9ZlK86G rJthLv1Ccs8kUvj4hUoIXGBSVJl0t/n05hJTd19gLOgyOs3F33OM+VvnlAfEjrvyrxpx Z2ykOwHFbPyGiTxwgXMuEs13gqpXy86BfX0CbImI1FuowfF7A6ZN3KFv75mD8TRppBu8 5hAz3gGALPibpqLpjv7j6wO4n1p/03Oq1mdvZUgUquPpj6bMFmNd80be2FB4Oqml4HiC lebA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=FvH/i4pE7VhoCJ55AMjBaY0NA/7/jsPnnp7rzUKCBlI=; b=h//iO6DsWKy/mXlGDDpoRv4ID8JXJhCsqBUmvpb8Xw2YxGO7xH7B2U19cD82nEiEDW 0npzdiVOMZlKiERL9vv7Ask2PTiY6kFMh78Fo+1xC1E1aXvwT8+HflIMqA4ORV37IyeX qFMhrkiUL9/kT+bD0oNINEgFBoCYsx6EYDURKhYj2uW8kewoCiP2CLZaq91XGyyCyKnh r4WEWIuUpfPsK3IwFMcR0U22DeSmxEzKF1qqSws33s4Yo2khPrfhLAoD8i3pcgxGRvQq giArMQf7OIBrfwbbzC0kVtSVDZFm4XlUXnCfwDFvsjUubyPaMRuZODnhW3dpgk6BDnpv EV7w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si9612897pfl.272.2018.01.19.09.07.13; Fri, 19 Jan 2018 09:07:28 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756189AbeASRFn (ORCPT + 99 others); Fri, 19 Jan 2018 12:05:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38062 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755878AbeASRFi (ORCPT ); Fri, 19 Jan 2018 12:05:38 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8538F36809; Fri, 19 Jan 2018 17:05:38 +0000 (UTC) Received: from ming.t460p (ovpn-12-54.pek2.redhat.com [10.72.12.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A73FE5D6A2; Fri, 19 Jan 2018 17:05:24 +0000 (UTC) Date: Sat, 20 Jan 2018 01:05:20 +0800 From: Ming Lei To: Jens Axboe Cc: Mike Snitzer , Bart Van Assche , "dm-devel@redhat.com" , "hch@infradead.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "osandov@fb.com" Subject: Re: [RFC PATCH] blk-mq: fixup RESTART when queue becomes idle Message-ID: <20180119170519.GF14827@ming.t460p> References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 19 Jan 2018 17:05:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 09:52:32AM -0700, Jens Axboe wrote: > 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. Yeah, if we decide to take the approach of introducing NO_DEV_RESOURCE, all the current STS_RESOURCE for non-device resource allocation(kmalloc, dma map, get_request, ...) should be converted to NO_DEV_RESOURCE. And it is a generic issue, which need generic solution. Seems running queue after arbitrary in this case is the only way we thought of, or other solutions? If the decision is made, let's make/review the patch, :-) -- Ming