From patchwork Fri Aug 17 14:36:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10568931 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 D6D35139A for ; Fri, 17 Aug 2018 14:36:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C936A2BBD1 for ; Fri, 17 Aug 2018 14:36:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCDE72BBD0; Fri, 17 Aug 2018 14:36:49 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 649F92BBD0 for ; Fri, 17 Aug 2018 14:36:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727037AbeHQRkX (ORCPT ); Fri, 17 Aug 2018 13:40:23 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:39017 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726904AbeHQRkX (ORCPT ); Fri, 17 Aug 2018 13:40:23 -0400 Received: by mail-lj1-f193.google.com with SMTP id l15-v6so6539770lji.6 for ; Fri, 17 Aug 2018 07:36:46 -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:mime-version :content-transfer-encoding; bh=KCDE1ZF45ByvaJtahq21Emr53yAzkpYEpRNwVGdLgZ0=; b=CmZwhwaA5y2FQ4x6XrWG031v7CE7l9hbM61vACly9YNSKeVEhbuvhib9QjiaHjPCEg MCLdzwjenLxLz+vg7dj6ivUt8hmyhWs8w/w/etgQ0Aj049SwTjCCAOuxOvJ6uJbPLChD C1qJSWTicv67YGmEbEqqI1PLjpn/J4ZQ7B2tL49GdYUtenUXV1jcVZmwGkj/nInTF9Sp bofPGTxLt9v7DUNZ2Cn6sIQZhP1fL6ubnZ0lpJpjlX0iW/VHFiR/xWLUBesSlMBUP0D8 vWk+sH9VUVvUA8NLMKs4CB0H07nBJ/A0wdL4eFSNat8DxHmT272ZxotgGtWKOZ6mqIWW 2dKQ== 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:mime-version :content-transfer-encoding; bh=KCDE1ZF45ByvaJtahq21Emr53yAzkpYEpRNwVGdLgZ0=; b=WNnt5H3U+FTzZHl8SigVHIQFYzdvrLD6ZsqxsUducGrC3L78hlCbyRMXUCqeuq+d73 FHBuSPHs9wXkvPUZ9ql+hR4SXNhrj2qwxjiLaWvSwfOvW9kYcaa/TaH3ZBRsrGw/ODmf GR9L8tIihglwD6sEVp0CNsbsF5VDBo5EPUm1sv49IJviy1qdVqYTGwQDV1uX5d4C+PMW aclaIIp/8am23Jw3uucEccawmjhvRftizSmrKQtFi3SYoFnaGKotovvH5uY07HfFKwd+ mnt6g+La/wuhLvPJy8RtFAsye5FOIpLVwvUYBLteeTnyMZnULc18E24ZS7NgPJmSOdS6 HI+g== X-Gm-Message-State: AOUpUlGElShk1UKo/i2wgkRnO4zdslPxsc8gyoCYggYkhojZY+BSpW04 DsvhVjNVVgQH0xBT9rOKZhs2Mg== X-Google-Smtp-Source: AA+uWPx/mLuiCom3FG9qcCvx+Fw6zTwYITKDWTmqzMHZaD35vNviLjm6GojzwNpB6AvIbqvC3xNbRQ== X-Received: by 2002:a2e:8950:: with SMTP id b16-v6mr20287729ljk.111.1534516606243; Fri, 17 Aug 2018 07:36:46 -0700 (PDT) Received: from localhost.localdomain (95-166-82-66-cable.dk.customer.tdc.net. [95.166.82.66]) by smtp.gmail.com with ESMTPSA id i1-v6sm337375ljg.43.2018.08.17.07.36.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 07:36:45 -0700 (PDT) From: =?utf-8?q?Matias_Bj=C3=B8rling?= To: igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, javier@cnexlabs.com, hans.holmberg@cnexlabs.com, hlitz@ucsc.edu, youngtack.jin@circuitblvd.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Mat?= =?utf-8?q?ias_Bj=C3=B8rling?= Subject: [PATCH] lightnvm: pblk: fix incorrect min_write_pgs Date: Fri, 17 Aug 2018 16:36:37 +0200 Message-Id: <20180817143637.15943-1-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 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 The calculation of pblk->min_write_pgs should only use the optimal write size attribute provided by the drive, it does not correlate to the memory page size of the system, which can be smaller or larger than the LBA size reported. Signed-off-by: Matias Bjørling Reviewed-by: Javier González --- drivers/lightnvm/pblk-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 9119c64d6f62..8adc8ac8b03c 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -371,7 +371,7 @@ static int pblk_core_init(struct pblk *pblk) atomic64_set(&pblk->nr_flush, 0); pblk->nr_flush_rst = 0; - pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE); + pblk->min_write_pgs = geo->ws_opt; max_write_ppas = pblk->min_write_pgs * geo->all_luns; pblk->max_write_pgs = min_t(int, max_write_ppas, NVM_MAX_VLBA); pblk_set_sec_per_write(pblk, pblk->min_write_pgs);