From patchwork Tue Sep 22 10:52:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11792159 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3A6D6CB for ; Tue, 22 Sep 2020 10:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFBEE23A34 for ; Tue, 22 Sep 2020 10:52:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="wBn1/vKi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbgIVKwo (ORCPT ); Tue, 22 Sep 2020 06:52:44 -0400 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:9245 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbgIVKwn (ORCPT ); Tue, 22 Sep 2020 06:52:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1600771963; x=1632307963; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=0dU7YfFywii/Po1R39ApRo2sKwRx3dgwXOoeAeCRN34=; b=wBn1/vKi+LvApNsPZo5VhMDLIxBPJJcXxrodg5ZXgaBcy5SJqbML8st0 Xsur+C2f18Ihr3hKUfRBke3QcNqtmIhRROZx3VlgZPGyhdrUAm1hKXRa+ C26ObtKXoWwy+hH8Ed309N5XmyF3+dR/Z3aHoEV+CZmLb446jrf6x5XT6 w=; X-IronPort-AV: E=Sophos;i="5.77,290,1596499200"; d="scan'208";a="56925064" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 22 Sep 2020 10:52:42 +0000 Received: from EX13D31EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com (Postfix) with ESMTPS id CA02DA1DAD; Tue, 22 Sep 2020 10:52:39 +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:34 +0000 From: SeongJae Park To: , , CC: SeongJae Park , , , , , , , , Subject: [PATCH v2 1/3] xen-blkback: add a parameter for disabling of persistent grants Date: Tue, 22 Sep 2020 12:52:07 +0200 Message-ID: <20200922105209.5284-2-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 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-block@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. But, there is no option to disable it. For the reason, this commit adds a module parameter for disabling of the feature. [1] https://wiki.xen.org/wiki/Xen_4.3_Block_Protocol_Scalability Signed-off-by: Anthony Liguori Signed-off-by: SeongJae Park --- .../ABI/testing/sysfs-driver-xen-blkback | 9 ++++++ drivers/block/xen-blkback/xenbus.c | 28 ++++++++++++++----- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-driver-xen-blkback b/Documentation/ABI/testing/sysfs-driver-xen-blkback index ecb7942ff146..ac2947b98950 100644 --- a/Documentation/ABI/testing/sysfs-driver-xen-blkback +++ b/Documentation/ABI/testing/sysfs-driver-xen-blkback @@ -35,3 +35,12 @@ Description: controls the duration in milliseconds that blkback will not cache any page not backed by a grant mapping. The default is 10ms. + +What: /sys/module/xen_blkback/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 backends. + The default is Y (enable). diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index b9aa5d1ac10b..8a95ddd08b13 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -879,6 +879,12 @@ static void reclaim_memory(struct xenbus_device *dev) /* ** Connection ** */ +/* 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"); + /* * Write the physical details regarding the block device to the store, and * switch to Connected state. @@ -906,11 +912,15 @@ static void connect(struct backend_info *be) xen_blkbk_barrier(xbt, be, be->blkif->vbd.flush_support); - err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u", 1); - if (err) { - xenbus_dev_fatal(dev, err, "writing %s/feature-persistent", - dev->nodename); - goto abort; + if (feature_persistent) { + err = xenbus_printf(xbt, dev->nodename, "feature-persistent", + "%u", feature_persistent); + if (err) { + xenbus_dev_fatal(dev, err, + "writing %s/feature-persistent", + dev->nodename); + goto abort; + } } err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu", @@ -1093,8 +1103,12 @@ static int connect_ring(struct backend_info *be) xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol); return -ENOSYS; } - pers_grants = xenbus_read_unsigned(dev->otherend, "feature-persistent", - 0); + if (feature_persistent) + pers_grants = xenbus_read_unsigned(dev->otherend, + "feature-persistent", 0); + else + pers_grants = 0; + blkif->vbd.feature_gnt_persistent = pers_grants; blkif->vbd.overflow_max_grants = 0; From patchwork Tue Sep 22 10:52:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11792161 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4215B59D for ; Tue, 22 Sep 2020 10:52:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1317F23A1B for ; Tue, 22 Sep 2020 10:52:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="eVxUdfoF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbgIVKwu (ORCPT ); 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 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-block@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); From patchwork Tue Sep 22 10:52:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11792163 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFD006CB for ; Tue, 22 Sep 2020 10:52:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86E3823A34 for ; Tue, 22 Sep 2020 10:52:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="OEKlQRT7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726577AbgIVKw5 (ORCPT ); Tue, 22 Sep 2020 06:52:57 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:30357 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbgIVKw5 (ORCPT ); Tue, 22 Sep 2020 06:52:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1600771977; x=1632307977; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=o7irTIbRXOJQafppIl9QY5dF6CNyW4qaMo6zKmMJeVI=; b=OEKlQRT7CVLleMg6gHeMvBDjQrPE0UIqMsYk4NcwpE6Fv2iAZvKYOnS9 qiBsTdZcitYWZemVaJG1tIfoqjNGH6bkMFlUZ4nFZr6rnuRUoT1PprQGz J7vfpfFvU2nNJmx8hgpgMieLuwkizmOtaxnkfWGNOocODBDjg57dyxiDe k=; X-IronPort-AV: E=Sophos;i="5.77,290,1596499200"; d="scan'208";a="70055190" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-a70de69e.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 22 Sep 2020 10:52:55 +0000 Received: from EX13D31EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1e-a70de69e.us-east-1.amazon.com (Postfix) with ESMTPS id 99DC9A1F35; Tue, 22 Sep 2020 10:52:52 +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:46 +0000 From: SeongJae Park To: , , CC: SeongJae Park , , , , , , , , Subject: [PATCH v2 3/3] xen-blkfront: Apply changed parameter name to the document Date: Tue, 22 Sep 2020 12:52:09 +0200 Message-ID: <20200922105209.5284-4-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 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-block@vger.kernel.org From: SeongJae Park Commit 14e710fe7897 ("xen-blkfront: rename indirect descriptor parameter") changed the name of the module parameter for the maximum amount of segments in indirect requests but missed updating the document. This commit updates the document. Signed-off-by: SeongJae Park --- Documentation/ABI/testing/sysfs-driver-xen-blkfront | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-driver-xen-blkfront b/Documentation/ABI/testing/sysfs-driver-xen-blkfront index 9c31334cb2e6..28008905615f 100644 --- a/Documentation/ABI/testing/sysfs-driver-xen-blkfront +++ b/Documentation/ABI/testing/sysfs-driver-xen-blkfront @@ -1,4 +1,4 @@ -What: /sys/module/xen_blkfront/parameters/max +What: /sys/module/xen_blkfront/parameters/max_indirect_segments Date: June 2013 KernelVersion: 3.11 Contact: Konrad Rzeszutek Wilk