From patchwork Wed Mar 8 07:03:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9610499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A6CB16016C for ; Wed, 8 Mar 2017 07:39:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66C4A285D2 for ; Wed, 8 Mar 2017 07:39:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B4F0285DB; Wed, 8 Mar 2017 07:39:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09D2E285D2 for ; Wed, 8 Mar 2017 07:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750743AbdCHHir (ORCPT ); Wed, 8 Mar 2017 02:38:47 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36567 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbdCHHip (ORCPT ); Wed, 8 Mar 2017 02:38:45 -0500 Received: by mail-wm0-f66.google.com with SMTP id v190so4532805wme.3 for ; Tue, 07 Mar 2017 23:38:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=limBRYeuD3MiskEPaUFJvSC2gYJYIGOuUZJxH1T/mrc=; b=FPeZoQ9dszLjlvHtlfPYsyz4g4e+PVOcKxpxVXIAySgX1uiWdDe61hsdxMj41Rr6UZ nUTpTBDvmiwNQd1D0UPxlm6hpZzI24NNo9U3J8wN4k5vb6bR577ma7dNrdruBzlXiXHq PqudMdh8ouIw+AAy9U2lCfghwb8z9xBGI8YFDJSVsiEg9f1NArV3yNNP2jDphz6y9+S9 6M/eQtEPkoC/o2TDoi5ydasxt1B2NCbpJMCQW4nca0aO2lN6RCaFyFzUDLMBRSG1mQi0 l3lIJIRW8qRILpoHiUG8re9fBrxFv0ND1CgwjbouxtNAX3Wn2lqxxTB0IYM/rF/huHGq blQA== X-Gm-Message-State: AMke39kYJCX8PkhTF6HPNrRrNJIcRWxCH0inZHMRvDg6RCx79ylhvzzoVLXcU6OLskXUmQ== X-Received: by 10.28.224.69 with SMTP id x66mr21603150wmg.21.1488956591284; Tue, 07 Mar 2017 23:03:11 -0800 (PST) Received: from [192.168.64.116] (bzq-82-81-101-184.red.bezeqint.net. [82.81.101.184]) by smtp.gmail.com with ESMTPSA id y49sm2876500wry.18.2017.03.07.23.03.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Mar 2017 23:03:10 -0800 (PST) Subject: Re: [PATCH 5/8] nowait aio: return on congested block device To: Goldwyn Rodrigues , jack@suse.com References: <20170228233610.25456-1-rgoldwyn@suse.de> <20170228233610.25456-6-rgoldwyn@suse.de> Cc: hch@infradead.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, Goldwyn Rodrigues From: Sagi Grimberg Message-ID: <0d1ba678-69c0-16ce-6c3e-475cd8da203c@grimberg.me> Date: Wed, 8 Mar 2017 09:03:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170228233610.25456-6-rgoldwyn@suse.de> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > - if (likely(blk_queue_enter(q, false) == 0)) { > + if (likely(blk_queue_enter(q, bio_flagged(bio, BIO_NOWAIT)) == 0)) { > ret = q->make_request_fn(q, bio); I think that for ->make_request to not block we'd need to set BLK_MQ_REQ_NOWAIT in blk_mq_alloc_data to avoid blocking on a tag allocation. Something like the untested addition below: --- -- -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 09af8ff18719..40e78b57fb44 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -119,6 +119,9 @@ struct request *blk_mq_sched_get_request(struct request_queue *q, if (likely(!data->hctx)) data->hctx = blk_mq_map_queue(q, data->ctx->cpu); + if (likely(bio) && bio_flagged(bio, BIO_NOWAIT)) + data->flags |= BLK_MQ_REQ_NOWAIT; + if (e) { data->flags |= BLK_MQ_REQ_INTERNAL;