Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3900526pxk; Tue, 22 Sep 2020 05:46:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbCdtDC3D7LCeS8v73LxTSLzTQwtNaLDf+qcNAM/J8v+MX4+JsD5Frjg3vmLpeTd1E06mP X-Received: by 2002:a17:906:d93b:: with SMTP id rn27mr4731168ejb.330.1600778817640; Tue, 22 Sep 2020 05:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600778817; cv=none; d=google.com; s=arc-20160816; b=Ml6XBlBG4by6D8uGPx50C8DSDMtB7vGvnhLCGfzp2PAQq/b9OdG6fQNEv2qWONbgKC JPwU60yvLx68DS8gsdg+3ubVweRUUU5jv8G0bk3X6tdkuKp/UL0v2VaKsZsqopSuDO60 sHQrDNE7OcYvgCpnxCAgltmNDYcMqiY3G5a2c2Wq2ZkZnvyUHs9+aFMubrRL9FEzMw49 YhzOA05XryuTCbP5rW2buAJItwCq5w+Otoc5Gn21oTfT5m6rlsgfDw4L3ZNbEMvRx3SI 3cUWgy1jeNB1ojB7E4Bg156+bY1253zRJymFc2C5V+9sQ/kcpenvOdVNK+g0h7TjqgCH tcOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=4NWeS0xwxjfjyP4fYO5lNehd5ZKrflGYWnJgAJBxqGc=; b=f48gywExZoM/ts3hwKqtJHNnwTSO5LOUYz2Ga8zPAXMLvg8/cQs4+HM5Oo3Q7cPgtT POGBwRhJSkRf3YzRpf0aP4iGc9wrkxdhP7f4YRIXgVgCKt/UKG3VhlbIQt2a/fGg1fh/ MZhDdehR+TnCa6w6g21OZf0W6crfpxDqghSD4edv8hHaDWaWi+j1sFErXDW2jie3tgmI JluE/C/f62NYDNCDyGBMXUw2b7Et7MKaG+i154252lvdKw8Uhd1qktOPFv3GDA0tTXV/ uAIx6YpFYZuV6L3a9jFUmTAqsA3ft/JHpx0tiGVNiFynOcO5YlHt+1KQYKUl0v6bnmNX MeTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="JsN94s/f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si8472448eja.292.2020.09.22.05.46.32; Tue, 22 Sep 2020 05:46:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="JsN94s/f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgIVMpZ (ORCPT + 99 others); Tue, 22 Sep 2020 08:45:25 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:10402 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726571AbgIVMpZ (ORCPT ); Tue, 22 Sep 2020 08:45:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1600778725; x=1632314725; h=from:to:cc:subject:date:message-id:mime-version: in-reply-to:content-transfer-encoding; bh=4NWeS0xwxjfjyP4fYO5lNehd5ZKrflGYWnJgAJBxqGc=; b=JsN94s/f5Er7SUolajdfNmQPufQPXBM3L/6NpLM9ygqipxGQWZJ5EfGM 9BOsU/aVcnxoWkOresjyxGLKsCO6olF0exMqrn3QELSxW2z8k950lGDeX aNKHDgsZe7XaojROqCEzQAauDknp9StOsJESClPZxkZMx0muLLNVqJBLv 8=; X-IronPort-AV: E=Sophos;i="5.77,290,1596499200"; d="scan'208";a="70090946" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-119b4f96.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 22 Sep 2020 12:45:19 +0000 Received: from EX13D31EUA004.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-119b4f96.us-west-2.amazon.com (Postfix) with ESMTPS id F00271A04B8; Tue, 22 Sep 2020 12:45:17 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.160.183) by EX13D31EUA004.ant.amazon.com (10.43.165.161) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 12:45:11 +0000 From: SeongJae Park To: =?UTF-8?q?J=C3=BCrgen=20Gro=C3=9F?= CC: SeongJae Park , , , SeongJae Park , , , , , , , , Subject: Re: [PATCH v2 2/3] xen-blkfront: add a parameter for disabling of persistent grants Date: Tue, 22 Sep 2020 14:44:44 +0200 Message-ID: <20200922124444.2231-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.43.160.183] X-ClientProxiedBy: EX13D07UWB002.ant.amazon.com (10.43.161.131) To EX13D31EUA004.ant.amazon.com (10.43.165.161) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Sep 2020 14:11:32 +0200 "Jürgen Groß" wrote: > On 22.09.20 12:52, SeongJae Park wrote: > > From: SeongJae Park > > > > Persistent grants feature provides high scalability. On some small > > systems, however, it could incur data copy overheads[1] and thus it is > > required to be disabled. It can be disabled from blkback side using a > > module parameter, 'feature_persistent'. But, it is impossible from > > blkfront side. For the reason, this commit adds a blkfront module > > parameter for disabling of the feature. > > > > [1] https://wiki.xen.org/wiki/Xen_4.3_Block_Protocol_Scalability > > > > Signed-off-by: SeongJae Park > > --- > > .../ABI/testing/sysfs-driver-xen-blkfront | 9 ++++++ > > drivers/block/xen-blkfront.c | 28 +++++++++++++------ > > 2 files changed, 29 insertions(+), 8 deletions(-) > > [...] > > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c > > index 91de2e0755ae..49c324f377de 100644 > > --- a/drivers/block/xen-blkfront.c > > +++ b/drivers/block/xen-blkfront.c > > @@ -149,6 +149,13 @@ static unsigned int xen_blkif_max_ring_order; > > module_param_named(max_ring_page_order, xen_blkif_max_ring_order, int, 0444); > > MODULE_PARM_DESC(max_ring_page_order, "Maximum order of pages to be used for the shared ring"); > > > > +/* Enable the persistent grants feature. */ > > +static bool feature_persistent = true; > > +module_param(feature_persistent, bool, 0644); > > +MODULE_PARM_DESC(feature_persistent, > > + "Enables the persistent grants feature"); > > + > > + > > #define BLK_RING_SIZE(info) \ > > __CONST_RING_SIZE(blkif, XEN_PAGE_SIZE * (info)->nr_ring_pages) > > > > @@ -1866,11 +1873,13 @@ static int talk_to_blkback(struct xenbus_device *dev, > > message = "writing protocol"; > > goto abort_transaction; > > } > > - err = xenbus_printf(xbt, dev->nodename, > > - "feature-persistent", "%u", 1); > > - if (err) > > - dev_warn(&dev->dev, > > - "writing persistent grants feature to xenbus"); > > + if (feature_persistent) { > > + err = xenbus_printf(xbt, dev->nodename, > > + "feature-persistent", "%u", 1); > > + if (err) > > + dev_warn(&dev->dev, > > + "writing persistent grants feature to xenbus"); > > + } > > > > err = xenbus_transaction_end(xbt, 0); > > if (err) { > > @@ -2316,9 +2325,12 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) > > if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0)) > > blkfront_setup_discard(info); > > > > - info->feature_persistent = > > - !!xenbus_read_unsigned(info->xbdev->otherend, > > - "feature-persistent", 0); > > + if (feature_persistent) > > + info->feature_persistent = > > + !!xenbus_read_unsigned(info->xbdev->otherend, > > + "feature-persistent", 0); > > + else > > + info->feature_persistent = 0; > > > > indirect_segments = xenbus_read_unsigned(info->xbdev->otherend, > > "feature-max-indirect-segments", 0); > > > > Here you have the same problem as in blkback: feature_persistent could > change its value between the two tests. Yes, indeed. I will fix this in the next version. Thanks, SeongJae Park