From patchwork Tue Oct 9 11:12:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10632277 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 B8EF715E8 for ; Tue, 9 Oct 2018 11:15:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9821628A5E for ; Tue, 9 Oct 2018 11:15:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C95828A6F; Tue, 9 Oct 2018 11:15:56 +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 225CA28A5E for ; Tue, 9 Oct 2018 11:15:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728113AbeJIScK (ORCPT ); Tue, 9 Oct 2018 14:32:10 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37344 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbeJIScK (ORCPT ); Tue, 9 Oct 2018 14:32:10 -0400 Received: by mail-pf1-f194.google.com with SMTP id j23-v6so680985pfi.4 for ; Tue, 09 Oct 2018 04:15:43 -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=UG5TyJ4mQLwlYDrNM4sIdv6PF17gqlPRsMtI7Jo8TAk=; b=U9gcIOA+BJPPcKUx2cJiROlhvWYAiUNyOkoHqMx+80x9BotdlkVhtc0j9krUyZ+Zka qd2NZ5DdSs6P7rMgUqukJfgwo9hXTv9HcG6IigLuBZ8RI4cLjZLK08KOQwNYkLzBsHyk xaoXuECGJ93bbINQQV9IqxK6uue8hIee9RXE+bs3+k4uWQNEQj/FjrS6LaRWuyR42hal 7DyL5ymeIR1hXaKg6T+WhH/Ej7I3EhZYsQCB9UeUqL7soZlKfdEVGHqLuAziRVC2OJsK 6iluUv1A1QDflPPEYy6C8Q44hz93iVgN+Kst0z4AV/mYeMzzTweeHUmfipZZSnQGARLh 2hZg== 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=UG5TyJ4mQLwlYDrNM4sIdv6PF17gqlPRsMtI7Jo8TAk=; b=DksNbQftAs7AWQBXQzx/gcwEAZ5uIC/KBNn+B2MRO5Y7esL5hKkIHMEQovlrRfTje9 ruD8Ua3qHGpBL5wf3K91Ogy9vu/GTjl6Y2CJh6yaADyhkFsUGrZXztFpzkjknSe9Jtvw HtLbvH69Yu6fM4fizc0aEaHZ3IMbOnD9zQzTZWoF/irTjBJo4Kj5XBQyeMu7MmZHLZE3 xmQm1pgpzu48yIZ2I2rIAFLYqSK+1lcDTiW5a29XWVYqWnj0wbZcwHOyu49MQ9UT3sw9 efFCg1Fp8ZtHq8LtL2kWQP17mCVbZxTesJAAqFp7/TaEktU/wSewvKnt5sfv+/6fWyo5 f3xw== X-Gm-Message-State: ABuFfogPeHCoysdW0pL9eHsoklT5j6ffJAJ6j/Ihi+v9/HlFi+fidpsQ RlFQfdhP0zfHMhOxUkd0MPQmQA== X-Google-Smtp-Source: ACcGV615r46l7cfrPXWMzgsZk6WYJifaV4XDqBZcOPpf5uduyRgcSl+9QppxAeQLZbLQB/GEa2w5Dw== X-Received: by 2002:a63:501:: with SMTP id 1-v6mr24842199pgf.205.1539083743373; Tue, 09 Oct 2018 04:15:43 -0700 (PDT) Received: from skyninja.hgst.com (rap-us.hgst.com. [199.255.44.250]) by smtp.gmail.com with ESMTPSA id p1-v6sm25342380pff.128.2018.10.09.04.15.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 04:15:42 -0700 (PDT) From: =?utf-8?q?Matias_Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Zhoujie Wu , =?utf-8?q?Matias_Bj=C3=B8rling?= Subject: [GIT PULL 44/45] lightnvm: pblk: consider max hw sectors supported for max_write_pgs Date: Tue, 9 Oct 2018 13:12:14 +0200 Message-Id: <20181009111215.7653-45-mb@lightnvm.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181009111215.7653-1-mb@lightnvm.io> References: <20181009111215.7653-1-mb@lightnvm.io> 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: Zhoujie Wu When do GC, the number of read/write sectors are determined by max_write_pgs(see gc_rq preparation in pblk_gc_line_prepare_ws). Due to max_write_pgs doesn't consider max hw sectors supported by nvme controller(128K), which leads to GC tries to read 64 * 4K in one command, and see below error caused by pblk_bio_map_addr in function pblk_submit_read_gc. [ 2923.005376] pblk: could not add page to bio [ 2923.005377] pblk: could not allocate GC bio (18446744073709551604) Signed-off-by: Zhoujie Wu Reviewed-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index e3573880dbda..e5239aba806b 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -407,6 +407,8 @@ static int pblk_core_init(struct pblk *pblk) 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->max_write_pgs = min_t(int, pblk->max_write_pgs, + queue_max_hw_sectors(dev->q) / (geo->csecs >> SECTOR_SHIFT)); pblk_set_sec_per_write(pblk, pblk->min_write_pgs); pblk->pad_dist = kcalloc(pblk->min_write_pgs - 1, sizeof(atomic64_t),