From patchwork Thu Jul 7 07:54:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 9218083 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 CC3C36048B for ; Thu, 7 Jul 2016 07:58:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C03DD28797 for ; Thu, 7 Jul 2016 07:58:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B51DD28799; Thu, 7 Jul 2016 07:58: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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 31E8D28794 for ; Thu, 7 Jul 2016 07:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756614AbcGGHyi (ORCPT ); Thu, 7 Jul 2016 03:54:38 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35035 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756604AbcGGHyf (ORCPT ); Thu, 7 Jul 2016 03:54:35 -0400 Received: by mail-wm0-f66.google.com with SMTP id a66so3512872wme.2 for ; Thu, 07 Jul 2016 00:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y6tqFz1uHBaAUMH9EuRV456aIYVnAW6RGScBoal95ZE=; b=HahcbNCkPv0BIWHfk6qLy6gC3HmfMC1fVVv6dzlP8if8WkgAbuLdxizJURY+OV1yi3 KxTGHCbwqTYY5y9etz3nxSfqE/NuTE2LCyB1u8RQn/jx0O924vlW6yqjEv0ikTUx3lls 4+/HiSBlNwxR/zU5az/gsJSfUBje4nPD3GPrM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y6tqFz1uHBaAUMH9EuRV456aIYVnAW6RGScBoal95ZE=; b=UvXUoOzOMg7TcN/MtYbzNdRr74qgdRarQvhpkz5W3YaIBrzUZ6YTQLu9/rVPXaJOCf 3ZN3zqBx48WoPtzv6i9pHhJLl9yP8hn9opcWJXDtShf9Q3z4ASjSSLQXArOy8zd6nfwA jSokPH4cDkbTj938Z746TqHoXVLjsxq/FaLG/2ZyX79i+ORIezE4IqJwwPd+qkK+Yv2C olSC3gogFb3YQPsEqrRB/zhOrt0/fTovD/eEJU2Mp4AdmgP4QRczAYDXLlfNZ0AR1r4x 8y6QN6U8EZfSC7LuxfU1gOvA8aQ4BlOmsTIqF49RTiZLBKXt4j/HiNjmCreoCEOKtJrY SoOw== X-Gm-Message-State: ALyK8tJB4UQ7CAyl9B9pse9cjOcTt8u1znBtEw+2Ma6WXcqu6ucvpKkAryRkyOmxSF/uxg== X-Received: by 10.194.81.138 with SMTP id a10mr27925689wjy.53.1467878074236; Thu, 07 Jul 2016 00:54:34 -0700 (PDT) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id i74sm1654796wmg.21.2016.07.07.00.54.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 00:54:33 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: Wenwei Tao , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 01/17] lightnvm: break the loop when rqd is not null Date: Thu, 7 Jul 2016 09:54:07 +0200 Message-Id: <1467878063-22919-2-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1467878063-22919-1-git-send-email-m@bjorling.me> References: <1467878063-22919-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 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 From: Wenwei Tao Break the loop when rqd is not null to reduce an unnecessary schedule. Signed-off-by: Wenwei Tao Signed-off-by: Matias Bjørling --- drivers/lightnvm/rrpc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index de86d72..736e669 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -96,10 +96,13 @@ static void rrpc_discard(struct rrpc *rrpc, struct bio *bio) sector_t len = bio->bi_iter.bi_size / RRPC_EXPOSED_PAGE_SIZE; struct nvm_rq *rqd; - do { + while (1) { rqd = rrpc_inflight_laddr_acquire(rrpc, slba, len); + if (rqd) + break; + schedule(); - } while (!rqd); + } if (IS_ERR(rqd)) { pr_err("rrpc: unable to acquire inflight IO\n");