Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3831430pxk; Tue, 22 Sep 2020 03:54:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzei4ihGRBsljffm3Yx6xVF/jZuDWL7w2xirE/BXl5Jd6avieGWLUEGBrFa5M7/I8NthAPK X-Received: by 2002:aa7:d58e:: with SMTP id r14mr3473127edq.52.1600772092124; Tue, 22 Sep 2020 03:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600772092; cv=none; d=google.com; s=arc-20160816; b=VZpPQ4SQ9oma7N9SgQgF9k8H852qUMsTKMhP/zJHbJvYip5PV04BzZhO14KJ0NIQrK 3PBU3Lzzimp1kjyXLO13SA1gvI4YgJva1r9K9dlng+ZuLbODHveTyPDPK+WsR4kIG+N9 9qdRtQ3V42PjwtOGKQcX3DzkqW2j6L49oi+GxqW2LIQDhlzzbKP8IzjOTuApYmrjrJaw Ufu6iF1wFdn70K8LPHxootirSDzb1Cme4IWoEcI2GnwGiSKvKJwymGtrS7bDPn+m2olT dNOYfo/9ZZwS+o2c5vOWvj4bHboX3oWXwd0fI/wFJeyZcZ1VSXSU7WWosLuKU1rkdzzg Dg9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bgixASFZMrz4uNYz/S35PVAa/iOnwmK2jo635pLG9Ls=; b=gqOTIw4k3BZzIDORelT1+sscHuNAhdSl5WSUy3AMS3wJI/S9WgM235ZzCd7RzrYSnR jgR7nIlFWzKtfYvc1EvyNwBmvONRizPcfQ2S6ZQhRqNcsVnJSeBiAIOfFUZDAdhEptKe lbsiZLQiei61+z/Px8xqAstoLch18EYOLbFBZnnnCQBEYx5uhAUa+wilbB2Mhot8XpjV IbRGpjIOGPYLpmm1km3BP27nRxhU4uDlnsznKwww+G+xzx9cT5crC19UE+6ykOhaid6s Ef9siuPprefq9EKTlPGWJkUvwtaMcAYmIqiDTp9bxDVnjgKMbZrzl+Sub0jA6IzrUoEq xpTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=eVxUdfoF; 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 v12si3556939ejy.233.2020.09.22.03.54.28; Tue, 22 Sep 2020 03:54:52 -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=eVxUdfoF; 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 S1726566AbgIVKwu (ORCPT + 99 others); Tue, 22 Sep 2020 06:52:50 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:1068 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbgIVKwu (ORCPT ); Tue, 22 Sep 2020 06:52:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1600771969; x=1632307969; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=bgixASFZMrz4uNYz/S35PVAa/iOnwmK2jo635pLG9Ls=; b=eVxUdfoFJdps0rEuxLbaWwXotgXSK4n77TtsqLjrj30/4AQBWH5J7oFe IVAywM/NWsgQTcE8xtvXRvPlXb9oNh1qVeH9acw0IplgT7Ru1Jr6ZwLwe Y+WlNF0cOeIehP6ECmZGbdeVzQXG1faigpXSuQMUvDGrSS4/mV8/px5FI c=; X-IronPort-AV: E=Sophos;i="5.77,290,1596499200"; d="scan'208";a="55490521" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 22 Sep 2020 10:52:48 +0000 Received: from EX13D31EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com (Postfix) with ESMTPS id 2879EA1D05; Tue, 22 Sep 2020 10:52:45 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.162.35) by EX13D31EUA004.ant.amazon.com (10.43.165.161) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 10:52:40 +0000 From: SeongJae Park To: , , CC: SeongJae Park , , , , , , , , Subject: [PATCH v2 2/3] xen-blkfront: add a parameter for disabling of persistent grants Date: Tue, 22 Sep 2020 12:52:08 +0200 Message-ID: <20200922105209.5284-3-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200922105209.5284-1-sjpark@amazon.com> References: <20200922105209.5284-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.35] X-ClientProxiedBy: EX13D14UWB003.ant.amazon.com (10.43.161.162) To EX13D31EUA004.ant.amazon.com (10.43.165.161) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/Documentation/ABI/testing/sysfs-driver-xen-blkfront b/Documentation/ABI/testing/sysfs-driver-xen-blkfront index c0a6cb7eb314..9c31334cb2e6 100644 --- a/Documentation/ABI/testing/sysfs-driver-xen-blkfront +++ b/Documentation/ABI/testing/sysfs-driver-xen-blkfront @@ -8,3 +8,12 @@ Description: is 32 - higher value means more potential throughput but more memory usage. The backend picks the minimum of the frontend and its default backend value. + +What: /sys/module/xen_blkfront/parameters/feature_persistent +Date: September 2020 +KernelVersion: 5.10 +Contact: SeongJae Park +Description: + Whether to enable the persistent grants feature or not. Note + that this option only takes effect on newly created frontends. + The default is Y (enable). 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); -- 2.17.1