Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1496768imm; Tue, 3 Jul 2018 12:15:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcpdNpMbGSXYDQar5BrrlMLIJd2BC6VJoQV/QOKRS1fu3KYW0kmGdO+vZSOr1FTNwUOKTWc X-Received: by 2002:a65:5a8a:: with SMTP id c10-v6mr22170654pgt.389.1530645351618; Tue, 03 Jul 2018 12:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530645351; cv=none; d=google.com; s=arc-20160816; b=kQeVIIv1YA2RtmgD8VXZvpDh3p1akjL3CQ7skB7AavGri35HHqo04anciOvwSOLkf0 FfV/tJwrJXHDVc9Yhj8dh2pEMYMBoDJRQjoQL3A47A6qtBcFNQxLOeAqGC1he3ycfQYl jbxZUYjQLzn/uRXAHXDTBAytrHLAFqvqz/bro+EQkLCukZKFBisSGQ+CSbLVqz6F9Y8x rCL1BtpsuzNc2DHazZ7WDSZOOwv0XGJ0oX1YFSvx3mJ0zHvtycBudDbAeAp25RjBQndW C497cgzskWUVD6RypEa3g0ih9XmR7sECUZerIMTXKVFlzsk5Q99bePe/IRL4x5FasbAk gaAw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=OcEN2iIQC3x1J6F/bvh/SzkV0jFjtxl8e5E4j4a7X5Q=; b=dHe6Z2Wh3iIObWbykwramcvOChIbUBMq4sdudcjRsBE6Ar2lrMCAfPoHr3FMqIFBc2 CraziiNumkQOwI9s6QZpvUzCUQa/820p5YD3w4EG7ZP63+yqTX7wUKE+hrL2SAT/PHq6 OqTWWOYIOtFIU+ue3D30niIHUokjHFeVGbQB+Q8vyuX1L9W10I7TjciONxn8A7fsFjbP AdC4onTCwMYeU7fowq9LADTGDAt92mnD5g5g1PqP5Cq8bq0Cm+9SvIuxR3aAjON9RQPu N6KotU2ojNia0wNr8TrK6hZyS1IdV5X1jiT8Kfku4HXMBXCLakvqrxd4+Oupjhb1+CEb 4hHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=likIWXwf; 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 k11-v6si1584138pgp.537.2018.07.03.12.15.36; Tue, 03 Jul 2018 12:15:51 -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=likIWXwf; 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 S933274AbeGCTOz (ORCPT + 99 others); Tue, 3 Jul 2018 15:14:55 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35267 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753086AbeGCTOx (ORCPT ); Tue, 3 Jul 2018 15:14:53 -0400 Received: by mail-lj1-f193.google.com with SMTP id i125-v6so2412480lji.2 for ; Tue, 03 Jul 2018 12:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OcEN2iIQC3x1J6F/bvh/SzkV0jFjtxl8e5E4j4a7X5Q=; b=likIWXwfRBtjt50rFvhT5KI7vwuFw74iqrPGVGpjP7H9sIWn55xfdUWrqZD/XqQWVp jXx5+nEm9pufJ/nHkhKSJEGgDjS4jgVbgIxdPy0fC7JUby7htadqvSn9Az2UAk9d+DmB rv4ObhqmAWpvBguRe/242oaaGcgKSf72Iv51uUN91dyl5a7VR2MQ56yH0RvlKstAc3aT e6ZcfsAuI6UaJ1mkxgp6Bz0Xa7DLxH0bYoOy2QIWLTaJeKqq1JqW9L8KB6cQtwCAKVVW LyHMmEmnkrqLQzN/9HPnrAUE4bXH2kbnQ4WesxMRo+y0FwKjBIANJa+KrYEcURYFm9Nv 6NjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OcEN2iIQC3x1J6F/bvh/SzkV0jFjtxl8e5E4j4a7X5Q=; b=kCtNWdr9vxDd76tGVHCm68Lvad9CKlw8iK8s2nty/9nCVP7FVvo/my0CmwnugeuCAg vsjZZsMJ+CF+wGfY/BWpwhdiHkqHyRJTMCJKqqTVHbx9CT5DfaWh6d7h2wJY7cSuenL0 /pBtDwWhxeNaLaYnP/OddTVHd8K3RfCrhzUdZU5tSaIefw1ARrIFFfiJX8m7XZiPRKeX o5W+dn8bsxjEi84UaqU/1Cnv72KTiH+kI0doB3ksovFy/nTEk+DGcyK2w3YxYrIdulqv q/emSCjVEdZPBgn+ss2++Zj5YGSKVFDHZS6uJDePZm8+nN0ylI76amylhxhuKC7XhJBr 8lbw== X-Gm-Message-State: APt69E2WL7/Ce8vIZJ3TWuFGNo92K3TShiCc72icyzRXkyMs3e7/8qw3 9WEQEPWVuPkqfLuEu4emFOV3yt9b X-Received: by 2002:a2e:2f02:: with SMTP id v2-v6mr21650051ljv.113.1530645292230; Tue, 03 Jul 2018 12:14:52 -0700 (PDT) Received: from [192.168.0.10] (95-166-82-66-cable.dk.customer.tdc.net. [95.166.82.66]) by smtp.googlemail.com with ESMTPSA id l90-v6sm390700lfk.38.2018.07.03.12.14.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 12:14:51 -0700 (PDT) Subject: Re: [PATCH] lightnvm: limit get chunk meta request size To: javier@cnexlabs.com Cc: igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, hans.holmberg@cnexlabs.com, hlitz@ucsc.edu, youngtack.jin@circuitblvd.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180702080223.13214-1-mb@lightnvm.io> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: Date: Tue, 3 Jul 2018 21:14:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/03/2018 09:10 PM, Javier Gonzalez wrote: >> On 2 Jul 2018, at 10.02, Matias Bjørling wrote: >> >> For devices that does not specify a limit on its transfer size, the >> get_chk_meta command may send down a single I/O retrieving the full >> chunk metadata table. Resulting in large 2-4MB I/O requests. Instead, >> split up the I/Os to a maximum of 256KB and issue them separately to >> reduce memory requirements. >> >> Signed-off-by: Matias Bjørling >> --- >> drivers/nvme/host/lightnvm.c | 10 ++++++++-- >> 1 file changed, 8 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c >> index b9989717418d..3b644b0e9713 100644 >> --- a/drivers/nvme/host/lightnvm.c >> +++ b/drivers/nvme/host/lightnvm.c >> @@ -583,7 +583,13 @@ static int nvme_nvm_get_chk_meta(struct nvm_dev *ndev, >> struct ppa_addr ppa; >> size_t left = nchks * sizeof(struct nvme_nvm_chk_meta); >> size_t log_pos, offset, len; >> - int ret, i; >> + int ret, i, max_len; >> + >> + /* >> + * limit requests to maximum 256K to avoid issuing arbitrary large >> + * requests when the device does not specific a maximum transfer size. >> + */ >> + max_len = min_t(unsigned int, ctrl->max_hw_sectors << 9, 256 * 1024); >> >> /* Normalize lba address space to obtain log offset */ >> ppa.ppa = slba; >> @@ -596,7 +602,7 @@ static int nvme_nvm_get_chk_meta(struct nvm_dev *ndev, >> offset = log_pos * sizeof(struct nvme_nvm_chk_meta); >> >> while (left) { >> - len = min_t(unsigned int, left, ctrl->max_hw_sectors << 9); >> + len = min_t(unsigned int, left, max_len); >> >> ret = nvme_get_log_ext(ctrl, ns, NVME_NVM_LOG_REPORT_CHUNK, >> dev_meta, len, offset); >> -- >> 2.11.0 > > Is this a v2? I remember seeing this patch being posted before [1]. It > still looks good to me :) > > > [1] https://lkml.org/lkml/2018/6/12/466 > > > Reviewed-by: Javier González > I changed the title. Since it didn't touch pblk. Thanks.