From patchwork Fri Oct 13 12:46:11 2017 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: 10004615 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 EFE3D60360 for ; Fri, 13 Oct 2017 12:59:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2E4D29061 for ; Fri, 13 Oct 2017 12:59:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7EC029066; Fri, 13 Oct 2017 12:59:12 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable 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 7512C29061 for ; Fri, 13 Oct 2017 12:59:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758271AbdJMM64 (ORCPT ); Fri, 13 Oct 2017 08:58:56 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:57286 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758204AbdJMMr3 (ORCPT ); Fri, 13 Oct 2017 08:47:29 -0400 Received: by mail-wm0-f65.google.com with SMTP id l68so21510635wmd.5 for ; Fri, 13 Oct 2017 05:47:28 -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=Gml/3ooELHrNmYDvwM4Dp/SwWmR5hEPY+duKRsCxzrs=; b=vr4m+bu6c9TrGqjqDn9mENbH/25Q2mQyKGx+yhAJWUkh2oS1a96xm2/AFHx2z6fzB/ O/UAltpiXqdlJlEgGt2zDCvZoURWKLcNnRo44c2t81BFttoPyy/8CxRDpOHUq3QdOIat gTyFgS4Kkzp5aoCAMX88QjeVmdnK0I6HDS+dc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Gml/3ooELHrNmYDvwM4Dp/SwWmR5hEPY+duKRsCxzrs=; b=tlDyAwpqrfCGDHLzFMFvcSY7wTvoTU1pwN2OEVO/rnhvkz+8umdt1LdgsCVJDL56eb If+eAkjdiKnLxNfbHBnCIrVjg8YW9hOyqMT+WuknRDYbyaQKaJ/5avXj8/fjF/vZcmF7 sF1Guu2u/X2HGcXSUrk6BMYQBTwpsRm2+2F3mXU/MuAE1eI9GEojsakFAurqjnWGEbhx zULNsSeWmu/HxIrzySFvYBng5MPnc5quz066FYHli9GCZTsErsONy5qsnKpLUVQVnYzB JhvgAWkyilOc2Q41RnjQk8vKJQMbwJZ8GV5dwg8BWd5scZiFT3uZRGaEoa+DKDrJV7Ko T23A== X-Gm-Message-State: AMCzsaUlmxJ74/DzF2Vd24oRJ9uvjJNW7+g6DJlznpdMJMjwLwEm5vJ7 lS1xdV6hZEQOQx53VXmrH5EW5A== X-Google-Smtp-Source: AOwi7QD2Jlre3Uc75yLnzWREgo5TGkueACOEFVjN+U6RrZxa2d9enD2XG5hKmTuBHmYJ6DA+eKAxUw== X-Received: by 10.80.216.12 with SMTP id o12mr2095286edj.10.1507898847775; Fri, 13 Oct 2017 05:47:27 -0700 (PDT) Received: from skyninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id p91sm735012edp.69.2017.10.13.05.47.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 05:47:26 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 22/58] lightnvm: pblk: use constant for GC max inflight Date: Fri, 13 Oct 2017 14:46:11 +0200 Message-Id: <20171013124647.32668-23-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171013124647.32668-1-m@bjorling.me> References: <20171013124647.32668-1-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: Javier González Use a constant to set the maximum number of inflight GC requests allowed. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-gc.c | 4 ++-- drivers/lightnvm/pblk.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index f163829..c21b207 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -93,7 +93,7 @@ static int pblk_gc_move_valid_secs(struct pblk *pblk, struct pblk_gc_rq *gc_rq) retry: spin_lock(&gc->w_lock); - if (gc->w_entries >= PBLK_GC_W_QD) { + if (gc->w_entries >= PBLK_GC_RQ_QD) { spin_unlock(&gc->w_lock); pblk_gc_writer_kick(&pblk->gc); usleep_range(128, 256); @@ -602,7 +602,7 @@ int pblk_gc_init(struct pblk *pblk) spin_lock_init(&gc->w_lock); spin_lock_init(&gc->r_lock); - sema_init(&gc->gc_sem, 128); + sema_init(&gc->gc_sem, PBLK_GC_RQ_QD); INIT_LIST_HEAD(&gc->w_list); INIT_LIST_HEAD(&gc->r_list); diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 60edcda..baa6a63 100644 --- a/drivers/lightnvm/pblk.h +++ b/drivers/lightnvm/pblk.h @@ -816,7 +816,7 @@ int pblk_recov_setup_rq(struct pblk *pblk, struct pblk_c_ctx *c_ctx, * pblk gc */ #define PBLK_GC_MAX_READERS 8 /* Max number of outstanding GC reader jobs */ -#define PBLK_GC_W_QD 128 /* Queue depth for inflight GC write I/Os */ +#define PBLK_GC_RQ_QD 128 /* Queue depth for inflight GC requests */ #define PBLK_GC_L_QD 4 /* Queue depth for inflight GC lines */ #define PBLK_GC_RSV_LINE 1 /* Reserved lines for GC */