Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp537812imm; Fri, 13 Jul 2018 01:50:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcmZAgemJC2Ar7kDqVQ0L7DVg0FQ5prXPlCvto3tggwQvGHMxeYp/qSBOMQR0kcfSLAo5mf X-Received: by 2002:a63:4b1f:: with SMTP id y31-v6mr5358614pga.14.1531471814303; Fri, 13 Jul 2018 01:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531471814; cv=none; d=google.com; s=arc-20160816; b=swIs4Ck+IFUK5WNTmVY18YRrozTMGTSnJM8yHNW9g5NIhee1SeUPyOhPaFY+Gvg3Wr w7rolvE2NPSw2lafom2NuhIGnNjn+au2KlbIjVT+oZ3qK5gEY6Dz5MAVhqnxaMaMIn8X /EsGPX25ea3QP9T8bPXyhL3iwEjle5q+ONG2hguHjfuy9E65oYiH2BElxUit6ZoxSX++ RdpvkM8gr9Xqu95iA/uJ5IDVBy7heby18V99pqP6ptTpej0mN7P2uXJn1zZrbyrdzk/X yO1U5I9sHl80vOCGdqILfeZ6bukKWA2TjN0JS6lodIXb97Ttbw1qosDK4o9++sY/jM7W OclQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=h9TSJBTfCijmeX0Vh6R44kV63q3BgW0B4f7Uq7MIXjw=; b=r2Bd3VnFrDgXd0XTcE7c1BIXMYYczMSR372dUrjDVbBB6bDkmEtFW/dkg0A4z3DqiM MgnQB7h+m7NWWZoKBOiNoNEi3whDqRi5DJGkDZZVFQ7Om9Fym7QtaeCXQhFa5EiL7Irs 2eCsSAVE+Z2h/zo9UxPZ1+eGyqBKlqBfvHUuqHkwpJfjvBIbGn4BvcfjOTjhQnoagKOO n7DJEdt+OtEDp/jPFRj8dGkp34+F5JxUI5swEfnUCv2suNRHGG8Ap641kn37rvrbwNJJ DbPzYjovs3ogsogogqU6wSZH2ASxXFZHl0zKUwFFHyed710HxbUiaHLJg81ioCFE8C1K jVcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=eiyq6Kxp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r24-v6si23020235pgo.295.2018.07.13.01.49.59; Fri, 13 Jul 2018 01:50:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=eiyq6Kxp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729618AbeGMJCw (ORCPT + 99 others); Fri, 13 Jul 2018 05:02:52 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:41340 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728226AbeGMJCv (ORCPT ); Fri, 13 Jul 2018 05:02:51 -0400 Received: by mail-pl0-f67.google.com with SMTP id w8-v6so11931181ply.8 for ; Fri, 13 Jul 2018 01:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h9TSJBTfCijmeX0Vh6R44kV63q3BgW0B4f7Uq7MIXjw=; b=eiyq6KxpJX5ZFUt33KY9eofKC0mdL+etO5IJXpYxpKO2YX2XqaIhtw3AT5rYa/k8vp WPYQweW0rVkPA/FjYBTxUiwBrSu11Q8yj4BIduGaWFuQZDWhoYNeb5o0KLEHii/G+Rwp TetS/sNdS7K3eTPfQVqLD4yNAudR2+46GD10EJ7NbPlNm6WQW7q3OyhtQsIPHnFeKXKg cZn3Z6lMYwqnKy4vebpHSSTi4fRbvGnMJ7VNFu+/AySiL+uKmlM1veCOs2uF25HLG05v d0cy9KMuVizbMDqVaFFgvt6OpjghH+HXTstv/jk94txo0RTeLAEFr5AWwGuvCDLCpl09 WmFA== 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=h9TSJBTfCijmeX0Vh6R44kV63q3BgW0B4f7Uq7MIXjw=; b=sj7hks8Osp/U1b+bRhgfuL8CkBeKxUfx4a9HEG2c7VO3IAjBC6jzvPj/4sCtTQBOeI jRpHOXKP8jp+LFSvM7f6K1hnWU3OMp1sWTIvd2so0M2IMeU1+M0dKMb1SmUJWBapqjBN b5/yb9zHAiyWAoC4Bda+Cg/K6Nis0OpWot69ZQeGI/OM/mbKQdZbXkiQkHr9cg1evGd5 LonUsklQWeGGrrK1hBWwTN9viKS/4y7qXbv/g02f4JUCIQt+YQx5tBK5v6GZWccJkM+M 4z7oJBX0QMqCwn5YtGGK+u9mxLwSQRwdJcKu6aS5AASl1twl9ETIRkbB0rJUcv6845TF bioA== X-Gm-Message-State: AOUpUlERzTVteg+J7qTpsYYpkM2Rt/+k1CS9AqnuXIxH80Mz7vJShPZz swyzAFeo2+9Qa6L+FJjasvQ8BQ== X-Received: by 2002:a17:902:8f8e:: with SMTP id z14-v6mr5460951plo.139.1531471752002; Fri, 13 Jul 2018 01:49:12 -0700 (PDT) Received: from skyninja.hgst.com (rap-us.hgst.com. [199.255.44.250]) by smtp.gmail.com with ESMTPSA id d18-v6sm569357pgo.74.2018.07.13.01.49.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 01:49:10 -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, bart.vanassche@wdc.com, hans.holmberg@cnexlabs.com, javier@cnexlabs.com, hlitz@ucsc.edu, igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 01/10] lightnvm: pblk: handle case when mw_cunits equals to 0 Date: Fri, 13 Jul 2018 10:48:36 +0200 Message-Id: <20180713084845.19511-2-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180713084845.19511-1-mb@lightnvm.io> References: <20180713084845.19511-1-mb@lightnvm.io> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcin Dziegielewski Some devices can expose mw_cunits equal to 0, it can cause the creation of too small write buffer and cause performance to drop on write workloads. Additionally, write buffer size must cover write data requirements, such as WS_MIN and MW_CUNITS - it must be greater than or equal to the larger one multiplied by the number of PUs. However, for performance reasons, use the WS_OPT value to calculation instead of WS_MIN. Because the place where buffer size is calculated was changed, this patch also removes pgs_in_buffer filed in pblk structure. Signed-off-by: Marcin Dziegielewski Signed-off-by: Igor Konopko Reviewed-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 9 +++++---- drivers/lightnvm/pblk.h | 3 --- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index b57f764d6a16..ef8d8dea7b6b 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -179,11 +179,14 @@ static int pblk_rwb_init(struct pblk *pblk) struct pblk_rb_entry *entries; unsigned long nr_entries, buffer_size; unsigned int power_size, power_seg_sz; + int pgs_in_buffer; - if (write_buffer_size && (write_buffer_size > pblk->pgs_in_buffer)) + pgs_in_buffer = max(geo->mw_cunits, geo->ws_opt) * geo->all_luns; + + if (write_buffer_size && (write_buffer_size > pgs_in_buffer)) buffer_size = write_buffer_size; else - buffer_size = pblk->pgs_in_buffer; + buffer_size = pgs_in_buffer; nr_entries = pblk_rb_calculate_size(buffer_size); @@ -366,8 +369,6 @@ static int pblk_core_init(struct pblk *pblk) atomic64_set(&pblk->nr_flush, 0); pblk->nr_flush_rst = 0; - pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns; - pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE); max_write_ppas = pblk->min_write_pgs * geo->all_luns; pblk->max_write_pgs = min_t(int, max_write_ppas, NVM_MAX_VLBA); diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 34cc1d64a9d4..9d1a0e86e082 100644 --- a/drivers/lightnvm/pblk.h +++ b/drivers/lightnvm/pblk.h @@ -608,9 +608,6 @@ struct pblk { int min_write_pgs; /* Minimum amount of pages required by controller */ int max_write_pgs; /* Maximum amount of pages supported by controller */ - int pgs_in_buffer; /* Number of pages that need to be held in buffer to - * guarantee successful reads. - */ sector_t capacity; /* Device capacity when bad blocks are subtracted */ -- 2.11.0