Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6024366ybp; Tue, 8 Oct 2019 11:49:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxy1P1yS+0jRRZiqm3I/4jtBSwpVYQGd/yvXzii/U/Ol/1za1rsUujU0yUuGpOZ5RDINV4G X-Received: by 2002:a17:906:ce46:: with SMTP id se6mr30311503ejb.198.1570560568829; Tue, 08 Oct 2019 11:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570560568; cv=none; d=google.com; s=arc-20160816; b=NKBFIdfEpFHYLY57vf59yVSzIbbzT2WYOLKhUb6dy46Jdq6vjv0gDFoQCOHWBSGtXS BfGgQ58x+8M5kbtYAduy5RvWxaEVXtux7FAdyIFTQf5o5trd1taYLAc5eh/JsE6eyA0k bWGTjS8fV1KgCuj5U8R8aedewszWOwSVySpE8/hpSkhkoHTtKyBy9slSTk3yZ3XFLQ6S 54aNYS4yGJRVpq13dVjtMnDYv8ULVkR3Lnoy1Ai4HuBqHTdyx9pT1qeJ6Z88Z5rvuL0a JvFhjZhpeZBMrwFfsGS3mOQCM0nSSm0PhXAEuG+jocmP+KzF4ottvDMK3OjPPkNVL6N6 aP3Q== 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:mime-version :user-agent:message-id:in-reply-to:date:references:organization :subject:cc:to:from; bh=XIYIBzmRCb1gwhwbLbKfEZZqUZhdGBfGLTpWHco+IqU=; b=ljKsGoa2B5PqdLGE+xuFl1AO1+hxA7k+r0XerM2RNi13kYNgYoO+5teEKi6AQQYsRp ZOLcy6a3XOrIM7oUaSNdlqJOU0qpS9z9XIjwLqjaQM1ZnC5USFYV/fiAhfQv/dDfSHFI 4sJ6AbwaZVDqJX0oJnYPH5toG4Z9iDOPGe4IYtyYRL7d5dUCr/TBwpXyzWAZiaLJrGac wVyL+Do8Kgx1BA0bA0eVOjC9Db0eVhBTe5PB+rxq/O0wuvPAG4+ZENT1hqiz7JapI52y qH+VUNDYfqPJh8Uu2EQ0YjlfoMizOrtNXT7YU78JJoWSKj4J3PY7hBMCjydlBjgZOt7c 9ZXQ== 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si9393408ejb.44.2019.10.08.11.49.05; Tue, 08 Oct 2019 11:49:28 -0700 (PDT) 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729794AbfJHSqs convert rfc822-to-8bit (ORCPT + 99 others); Tue, 8 Oct 2019 14:46:48 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:49846 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfJHSqr (ORCPT ); Tue, 8 Oct 2019 14:46:47 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 967AF28F6BB From: Gabriel Krisman Bertazi To: Bart Van Assche Cc: =?utf-8?Q?Andr=C3=A9?= Almeida , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, kernel@collabora.com Subject: Re: [PATCH v2 1/1] blk-mq: fill header with kernel-doc Organization: Collabora References: <20191008001416.12656-1-andrealmeid@collabora.com> <854l0j19go.fsf@collabora.com> <6aa48cd2-5f23-a4be-f777-d65bf755a976@acm.org> Date: Tue, 08 Oct 2019 14:46:31 -0400 In-Reply-To: <6aa48cd2-5f23-a4be-f777-d65bf755a976@acm.org> (Bart Van Assche's message of "Tue, 8 Oct 2019 10:30:58 -0700") Message-ID: <85zhibyt14.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bart Van Assche writes: > On 10/8/19 9:35 AM, Gabriel Krisman Bertazi wrote: >> André Almeida writes: >> >>> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h >>> index e0fce93ac127..8b745f229789 100644 >>> --- a/include/linux/blk-mq.h >>> +++ b/include/linux/blk-mq.h >>> @@ -10,74 +10,153 @@ struct blk_mq_tags; >>> struct blk_flush_queue; >>> /** >>> - * struct blk_mq_hw_ctx - State for a hardware queue facing the hardware block device >>> + * struct blk_mq_hw_ctx - State for a hardware queue facing the hardware >>> + * block device >>> */ >>> struct blk_mq_hw_ctx { >>> struct { >>> + /** @lock: Lock for accessing dispatch queue */ >>> spinlock_t lock; >>> + /** >>> + * @dispatch: Queue of dispatched requests, waiting for >>> + * workers to send them to the hardware. >>> + */ >> >> It's been a few years since I looked at the block layer, but isn't >> this used to hold requests that were taken from the blk_mq_ctx, but >> couldn't be dispatched because the queue was full? > > I don't think so. I think that you are looking for the requeue_list > member of struct request_queue. > Hmm, sorry, but I'm confused. I'm sure I'm missing something simple, since I haven't touched this in a while, so maybe you can quickly point me in the right direction? I see blk_mq_requeue_request() being used by device drivers to retry requests that failed, but if I read the code correctly, the flushed queue seems to be moved to hctx->dispatch when the device driver returned BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE to blk_mq_dispatch_rq_list(). I thought BLK_STS_RESOURCE was returned by the driver on .queue_rq() to signal there was no more resources on the hardware to service further requests. -- Gabriel Krisman Bertazi