From patchwork Mon Sep 17 20:15:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10603371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 256DC112B for ; Mon, 17 Sep 2018 20:15:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 192C02A319 for ; Mon, 17 Sep 2018 20:15:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CCA32A36B; Mon, 17 Sep 2018 20:15:58 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 A14E02A319 for ; Mon, 17 Sep 2018 20:15:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728401AbeIRBot (ORCPT ); Mon, 17 Sep 2018 21:44:49 -0400 Received: from out002.mailprotect.be ([83.217.72.86]:37905 "EHLO out002.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728190AbeIRBot (ORCPT ); Mon, 17 Sep 2018 21:44:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=IeVxgPXjHG+mqJB3iqL2B6+i2mD4Cz6P3hsiqaBv+J0=; b=vkdbm/3wXGIA lGqaIVFhOU6/63V2A9MfGnV8Qyv0cLnyuDE8bIfL8Z7gtwlD+/qQegC02tdbxf1Rb7tz31QXoNaHe Mehsvm80xTSRBX12kshd4EC4wA5mWa1E7AZE6Kyx75Lqld732/kTfFszhHSkwX6iBpnrVN3gOPog3 1quhjIRptLha/p3uiftmKAwAwt3fTMC4yZ55kfNlT1m6oY3/nZAi2DZAktMVi/4rBr1a45ijD8EXO AkahpIckSxE9oje6LV+Jj7F62Q4JyO9w/CaiTK5SppwXTU+DIL+fQUtsMz2SQ9I5VLemZON7pZI9C Uncoe9gTTUuFv3ab1qECmQ==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out002.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1g1zvv-000Aby-8e; Mon, 17 Sep 2018 22:15:47 +0200 Received: from asus.hsd1.ca.comcast.net (c-174-62-111-89.hsd1.ca.comcast.net [174.62.111.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id 28D4EC05E8; Mon, 17 Sep 2018 22:15:44 +0200 (CEST) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Ming Lei , Jianchao Wang , Hannes Reinecke , Johannes Thumshirn , Alan Stern Subject: [PATCH v7 4/6] block: Schedule runtime resume earlier Date: Mon, 17 Sep 2018 13:15:23 -0700 Message-Id: <20180917201525.26570-5-bvanassche@acm.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180917201525.26570-1-bvanassche@acm.org> References: <20180917201525.26570-1-bvanassche@acm.org> MIME-Version: 1.0 X-Originating-IP: 178.208.39.155 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-Outgoing-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Iq0Y2Jzv90W3CjUTmGGd+mYEZdhGLzllIZvSsvtlXVz1pRXWhjh9fdbl44I0 Df1nN63Cw5XairzMoRO+2yR7ItDrRh3SAoKW45chGCosKNDPNRgrf1AeViSeIVnMBBfBRBZgCikv OAMF/4pY8933x+uRyQECoIXFluPJGyJ2ePcQWk+3dNZU5rZYaF7U3qSQORcYm+eIaK9fUWr9RAN1 9ssFeollKTUEleC/aMh59YF7hUbm4nn1f8ypkbDQ8N7mh/jFPxqiQ662IrNcVOfW X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of scheduling runtime resume of a request queue after a request has been queued, schedule asynchronous resume during request allocation. The new pm_request_resume() calls occur after blk_queue_enter() has increased the q_usage_counter request queue member. This change is needed for a later patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 2 ++ block/elevator.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c index fd91e9bf2893..18b874d5c9c9 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -942,6 +942,8 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) if (success) return 0; + blk_pm_request_resume(q); + if (flags & BLK_MQ_REQ_NOWAIT) return -EBUSY; diff --git a/block/elevator.c b/block/elevator.c index 1c992bf6cfb1..e18ac68626e3 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -601,7 +601,6 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where) trace_block_rq_insert(q, rq); blk_pm_add_request(q, rq); - blk_pm_request_resume(q); rq->q = q;