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: 9610451 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 4F3316016C for ; Wed, 8 Mar 2017 07:05:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A86D285D2 for ; Wed, 8 Mar 2017 07:05:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BFCE28546; Wed, 8 Mar 2017 07:05:32 +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 035FC28546 for ; Wed, 8 Mar 2017 07:05:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933770AbdCHHF0 (ORCPT ); Wed, 8 Mar 2017 02:05:26 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34926 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751226AbdCHHFW (ORCPT ); Wed, 8 Mar 2017 02:05:22 -0500 Received: by mail-wm0-f68.google.com with SMTP id z63so4408873wmg.2; Tue, 07 Mar 2017 23:03:12 -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=OTbbA+PTuXH3k0+YCSHuyJjCQIlQ5PbIVkNiH1QtA7dxpJnBhv6ecohARER5Pw3QKw NwEtlnzrwgQMl0ruQoZqhWpzE90SgeOdLA82quEu73S/u2Kg2gP5aLKLjsH3RAMLVntx +Oh7WHBP/Yuv/5INn0ipGCxG/qYDbE9FPb4w+E4C57utqoa/pIkX5gmuiAFC/HgklVgf AjOQKXklt1OSgedXMucTqawrZKEEwLxRya7IukFXX95lWFMUdeSNwCLyvD2ka+hAVxZX 2WbAOLuGHFaYtSCcbP/Zlt2Jt+UrrEOzLy7GfJp/b/gWFM6vxG+Bkufknc/2rfFNFJyB OkCA== X-Gm-Message-State: AMke39kVZgD4hhCHyHFsbEJzGUrIzSNxKsYLe5j+Ydgfds3t0heK+88qx9UjwO+jpTWicQ== 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-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@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-btrfs" 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;