Received: by 10.223.176.46 with SMTP id f43csp1287903wra; Fri, 19 Jan 2018 09:21:41 -0800 (PST) X-Google-Smtp-Source: ACJfBosSHk7lO/ZCBTRrXO678vZcZbh/iLP5h+E5HB2NpIsGWKxQnZBv4bCFFeNSZN/faa0B7J7h X-Received: by 10.98.57.142 with SMTP id u14mr25801667pfj.237.1516382501069; Fri, 19 Jan 2018 09:21:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516382501; cv=none; d=google.com; s=arc-20160816; b=L+HLVNjjQVKo/F5S/A7sBshrT7k4js13CaFvEwuAl0PGC38bwNCQNzmCnP7RU559Fs WUTXWhNKyYlUcs2MjiQcOUEmtslJcEnTBRbz2TCOa8XsWmDci+Af6ny3em6vyBA1vKrb aQMK6QtXxSNKxpCO5taqxjq9G1uLnEewL95qTWW98xGMWBXPjkSvqCT8bZJJ0+LpNxXN tQZoLCKjnknKTps3BcFvtLFAvHV2gFJAlBysmclzcRUjA1pZL9aQN1WGXjZa7K4W6fr1 awh/HVT+mN2ZqXv3CKFIAimfKB5NVWs3PTnhJtxHh19Md/RCAMr/qL3HuWYvjXT6wdNC jteQ== 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=QwOhR1eM+lqZdDsiZX/INC0U5k7V0RNlNt3A9hQ6dco=; b=th6A8gfZIV0jusWluVIOM1aXOUsQL/Yf19UICDsHjwzdB8wD2Gcw3COPpCWTAY6nPI HrTfyyKc9KTmNj0C7KuCk+ItzuD/tcM2Fbs9TK0hVcFGEZB+Whw5p+YozIi56PJLQTwG b/i2Nf8Ucxdic0pjeVEDHO+dk9zaK83Mtn5Jzrss7IP9oVDZ2Hc1yN2mvE/gYqYwenJ4 jn2MAt7ouZJD7nKeUgT8u2qnF6kDeuIyYnKM4/y9lMlcAcgE6kXjad3zlXhK9XZ7dunc KCHtPmye7vpsdifL0PQVNHEYrUXvfXYM/brYZuzJm4Wi51r6IrhMoXiUbtOxm77yGIii eunQ== 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 x25si9801163pfj.295.2018.01.19.09.21.27; Fri, 19 Jan 2018 09:21:41 -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 S1756176AbeASRVF (ORCPT + 99 others); Fri, 19 Jan 2018 12:21:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38724 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755949AbeASRU5 (ORCPT ); Fri, 19 Jan 2018 12:20:57 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4737A61B8F; Fri, 19 Jan 2018 17:20:57 +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 55003600C2; Fri, 19 Jan 2018 17:20:48 +0000 (UTC) Date: Sat, 20 Jan 2018 01:20:44 +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: <20180119172043.GG14827@ming.t460p> References: <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> <20180119170519.GF14827@ming.t460p> <499af8b8-747a-ed0d-9b4c-e56e6e815a16@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <499af8b8-747a-ed0d-9b4c-e56e6e815a16@kernel.dk> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 19 Jan 2018 17:20:57 +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 10:09:11AM -0700, Jens Axboe wrote: > On 1/19/18 10:05 AM, Ming Lei wrote: > > 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. Or simply introduce BLK_STS_DEV_RESOURCE and convert out of real device resource into it, this way may be much easy to do. -- Ming