Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3357ybp; Tue, 8 Oct 2019 13:03:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxu9LThvDuTVe0eVXcO38ubee9xjixL0OwXhpeSeRdUpWAjzwznVjglw4cKQj2VMcvUtbG X-Received: by 2002:a50:9208:: with SMTP id i8mr35545305eda.3.1570564999214; Tue, 08 Oct 2019 13:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570564999; cv=none; d=google.com; s=arc-20160816; b=dKMK/+r1EP8FFb8ejs7WxwFaebXoSlvXSGzCB0LbtDr/nnl+2UHgUyhTWWnBn+Z8ho 3sJ3cFn/qb18+C+zti8bLXS2FT2+jEMrtNXx2dYhQniNAoTzi1gnUPlipd0Tx9j24a+q cwpNZOAVUNZr0uPv0H/CkepyvARNTk3YG+97Jfl1LiFr1+a/Ebr2Zjd1LHyKKjn4JYl7 YvmLlyymV2iFk5cVTYs15bCS1WgNYcpEX317AvxaaqyD4QSzFqGhv4eshIEFp68NvAxZ 63MEWcKupkywi/3q1mWE0b4dGtdyaQtVo79NO1zNdtketa35aaYp7A25/m6IkCTikz3S td6A== 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; bh=xPXZ9kF4GFL6v89vFU2ZEHo7SfcEsi52mwigB/rCYtY=; b=jO+bFE8VkF+V6TcxUkn6BJl+Vxt8UR6pYSySDd5Kmu8yTEZZ3tZigTNJVa4eyRfr3b YHe+JPormoNqC+nDGwq4d7vVovowlZpc039H1DYHDsJGpZahlDyfvyq29KsSc2bKRdtU ilg8Zf013Ozm/GwxtQL0vzu5CfTXLgK75d3hrsbZ0UQfXo5Psu6hrlxwSuPfnsSxmYgq v1PKhM/jOUvFdX2kNs0dT9qOD2ScZIOLCTxxpqAoxrkl566rBuSLgAIofOUlYwFdcXYD hPnEtqpalsT5IutTVXzX3yGKjb4yRLUEKBY5Xv6VJu+KtP/iaQEsB6CuD3RBk6Qg2LVM qvfA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id la20si8253627ejb.73.2019.10.08.13.02.52; Tue, 08 Oct 2019 13:03:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730697AbfJHUBm (ORCPT + 99 others); Tue, 8 Oct 2019 16:01:42 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40822 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729436AbfJHUBm (ORCPT ); Tue, 8 Oct 2019 16:01:42 -0400 Received: by mail-pf1-f196.google.com with SMTP id x127so8365pfb.7; Tue, 08 Oct 2019 13:01:42 -0700 (PDT) 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=xPXZ9kF4GFL6v89vFU2ZEHo7SfcEsi52mwigB/rCYtY=; b=BhI4JlPi1lB8pPxSfgsAth6LhYsw8p7P5yuNRi37rMX+qWOcNBYGl8KeFR3V2TVz2N 2v9VFIVAmv9P+eo+as+cjYCs6EaDPx18OLjpSj2hX71zbYQSHGiajGeg+r6r4PuLll4O PUIPHRX1TU8Z76NcOSdnSXabZEZEhaWkEtrhX+d/U/i1Ry00h0H3gNcw8lGIxPrVm8Jf gaEW2cactPIijXISDHBBQ8NaZiDHTRN30Ek7JbF4/eDF2X4THDaGVy5tu8CzMkH0oUhS VRuTiUf/Ro/SEfFCgLA8uwHPJ8hXiQdbZkUqkMTegV614E8O6cfJpT78y0KlIdVAgXTT duHA== X-Gm-Message-State: APjAAAXjV0nitAyGxrzdxV64EQmrvwruEZSQwl/qfFnU29L1pyek/dTv LH3pVYnipl0Y3M1mLAkMhN8= X-Received: by 2002:aa7:96f3:: with SMTP id i19mr41662272pfq.32.1570564901292; Tue, 08 Oct 2019 13:01:41 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id z29sm17759300pff.23.2019.10.08.13.01.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Oct 2019 13:01:40 -0700 (PDT) Subject: Re: [PATCH v2 1/1] blk-mq: fill header with kernel-doc To: Gabriel Krisman Bertazi Cc: =?UTF-8?Q?Andr=c3=a9_Almeida?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, kernel@collabora.com References: <20191008001416.12656-1-andrealmeid@collabora.com> <854l0j19go.fsf@collabora.com> <6aa48cd2-5f23-a4be-f777-d65bf755a976@acm.org> <85zhibyt14.fsf@collabora.com> From: Bart Van Assche Message-ID: <86de2c88-5812-4a87-b5d8-1b7b1808d013@acm.org> Date: Tue, 8 Oct 2019 13:01:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <85zhibyt14.fsf@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed 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 10/8/19 11:46 AM, Gabriel Krisman Bertazi wrote: > 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. Hi Gabriel, The simplified version of how requests are requeued as follows: * A block driver calls blk_mq_requeue_request(). * blk_mq_requeue_request() calls blk_mq_add_to_requeue_list() * blk_mq_add_to_requeue_list() executes the following code: list_add_tail(&rq->queuelist, &q->requeue_list) * A block driver or the block layer core calls blk_mq_kick_requeue_list() or blk_mq_delay_kick_requeue_list(). Both functions trigger a call of blk_mq_requeue_work(). * blk_mq_requeue_work() processes q->requeue_list. Bart.