Received: by 10.223.176.46 with SMTP id f43csp1274248wra; Fri, 19 Jan 2018 09:11:13 -0800 (PST) X-Google-Smtp-Source: ACJfBovJFTfaRRat9ZbZeEq0IxzAEQoGHrkwMeAjBbWyqYlzDrq/vjODt0OnesTotcYLQOfu7pQc X-Received: by 10.98.130.5 with SMTP id w5mr35253718pfd.117.1516381872915; Fri, 19 Jan 2018 09:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516381872; cv=none; d=google.com; s=arc-20160816; b=vSJ1W7Mts++A6QBzmttA3gfZ0DUSU61HYOMUHybxB20DwKiimK19umq0xy40EBTNia dNaRIlQ9orQQ0T9T6+jiOsoBm50xVYTTfYQv3SD6sKoeuPaynfQFlJm1MShoIxvyuRlZ 6nV1u0xU2sXo+TLISTakIkbnVU1clVgE0F93ZBCTrtLJzA7fG2GAuY5lARsJ0sbY2VEc fnYkcf2SVjIsLq4Zn3yZvhAL1HSDECA1Mfw3cVzpW+VXP/B80kvAMT5Hu5uqbST77f9G fgw4F7Ma7DadIZonNxEXTrjT3tYsby891Em7/GsKD7tYB6pJtmOydgdFVuxb8+YfmF2Q 3Pfg== 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=g+zr68IR016LXkK7NTUInPiUyU08R4zY8Y0Q3DU22hY=; b=jTxsPiNPwEIGKK2UZ/4HQLq5xIT1+ksijht861dY6UnJqH729ShHFkgexxPMyrEfxD x0kb8CNikfKMCr/D7aHd1xmAAlxmCQbu6GLa6N9lDo2DvXM63pFl1x2ym3OiuCbvV8eC G3qfrUpM9Wzjbb0uhZJBaiWRLcKNamFE692eLvtpD5z6hA6yR2Eez3Xwrlyv7UQd+HeF R4H3cqqXlbPhH/ab9eMsH6zblJL6OpFPh29ziV8XuBv3Ir8ThpEjSdF2QcaF6b/c3yCX twhGTM2itA9HSyRKqzQwpqJq1LlyOEBct5Fh9PO1jnTRZQFps2s56Gm0ziu9yJbeaSZy MR6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=VQoVJMYN; 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 w6si8258210pgq.273.2018.01.19.09.10.58; Fri, 19 Jan 2018 09:11:12 -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=VQoVJMYN; 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 S1756034AbeASRJV (ORCPT + 99 others); Fri, 19 Jan 2018 12:09:21 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:35544 "EHLO mail-it0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755878AbeASRJO (ORCPT ); Fri, 19 Jan 2018 12:09:14 -0500 Received: by mail-it0-f41.google.com with SMTP id e1so2899551ita.0 for ; Fri, 19 Jan 2018 09:09:14 -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=g+zr68IR016LXkK7NTUInPiUyU08R4zY8Y0Q3DU22hY=; b=VQoVJMYNFT3yQtYNWz61+2yd9We4M/aKHapkdkPhgIgHWExCKMWkOLjNUrrmmHAp75 INzTzUXYpV1/xAIA2LZdTK5a1zO0bYZQJjqoS3wZpuUijiYp4XjIhm1FplM5X/FIKQJL CYAQzR+VP3k56nRKlf9rAn/nQEaZI5VkLr4qQbTAyUGknljB8oeqzEgs0A4cAtXiqghJ KMbcX01RNAj+L5Mw19GJP1xCVm7LcsmadhjweDk5ROwlQN0DtR04vAwk+h5P3P/RCCTc DZj4jGCxDOW4mzl6XmLAxyYC38JnWcTqPYafRXLFSqwozgGljMMXxAv4WzOf9v/uFgZt lhdQ== 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=g+zr68IR016LXkK7NTUInPiUyU08R4zY8Y0Q3DU22hY=; b=E4GsGel/SDXCUU+D/R3kma/wZCYxI8vKkY4gj9Y+baOsDsLQ3yJRDSZieZS4cK04U3 AhzeoYjYZ+HLTQQMgXxTJl/6oBvtcOsi6v7Bq1AZryOd7ax5YHfkRFWEO5W/rmVLYuHe 4LQX03r/8pZXPv0tC7bmR2Xo2mxcbJU+cM+W4x0s04UaEL5TF8gMrkTiyHNl0+FhHTYa 4tAljpj31F7jUksHdpQqmFRCIina0M9Q1qhNq/qmHGwdIz5GCWWemJf1PDUIl0dtWNdP CjFAb/UeU92Y1prYVZZbBnLS8WdZyYeAiE/8MlD+7A0d4E0EsmFTZDGZPvcq++hwJ0uw pt7g== X-Gm-Message-State: AKwxytdf/bqg2M+OIMUiXAb5aqqh/XmYPEx1+ILQacluKurp/sWZ4CoJ mDG8eWYctsh9ztU7xnukdpnMtA== X-Received: by 10.36.165.79 with SMTP id w15mr29945439iti.127.1516381753948; Fri, 19 Jan 2018 09:09:13 -0800 (PST) Received: from [192.168.1.154] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id m184sm967742itg.8.2018.01.19.09.09.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 09:09:12 -0800 (PST) Subject: Re: [RFC PATCH] blk-mq: fixup RESTART when queue becomes idle To: Ming Lei 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" 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> <20180119170519.GF14827@ming.t460p> From: Jens Axboe Message-ID: <499af8b8-747a-ed0d-9b4c-e56e6e815a16@kernel.dk> Date: Fri, 19 Jan 2018 10:09:11 -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: <20180119170519.GF14827@ming.t460p> 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 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. > > And it is a generic issue, which need generic solution. Precisely. > Seems running queue after arbitrary in this case is the only way we > thought of, or other solutions? I think that is the only solution. If it's a frequent enough occurence to cause performance issues, then it's likely down to a specific resource shortage, and we can tackle that independently (we need to, since each of those will need a specialized solution). > If the decision is made, let's make/review the patch, :-) Let 'er rip. -- Jens Axboe