Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3831075pxk; Tue, 22 Sep 2020 03:54:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdpL0AV1dPqBXtxppqQzuz2PJt5CDAkzB0S0GwGvuKEjRas7oE5VzYykKlPV10/C/HIg2W X-Received: by 2002:a17:906:a88a:: with SMTP id ha10mr4457467ejb.532.1600772052448; Tue, 22 Sep 2020 03:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600772052; cv=none; d=google.com; s=arc-20160816; b=xviH8m41J+fdrXDthdeEhJcjJEVBmcTsseDmBUADOpgWSNVIKigllqrJ6+NAN6DvHX gKznULfTFBBzpdA141mBGJqBLZaoeM/n+6mSzqHlj+IJWeIDdNPh4Oe4tNGLkJkO+i1b /DE4uqyq6UC1pk/XA9ZlKDoq3I5cUyoEvu4JJRBt9Q3iP1bNPs/mKSSY1f80Zuke62cb QF3u3Z+fRgEJjX05SiTfG2/unPlDRiJuDW47R1AaK69CUZlG1jymTH2J8v1NG0dJQOkY 6u8OXP+/eIWxT4seR8BeGyKpibSbbA/cVZWLcSTaTb4ZeqMCl0GyToyJu4qhG6Hn9CYb FFaw== 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=0dU7YfFywii/Po1R39ApRo2sKwRx3dgwXOoeAeCRN34=; b=SL9Jrq3RhzctjKznukuKXTzm00x0y59CdlfE9Znbc9bh+9MlSI6xgiEXLRx/QgVt+F WKLH/rVnMFKftNylgVM0N5G1wQSJu9nCA+/PnKqfgNuxlOqtEiflblsKRv5//ZG085PD MYcrsI0xZCDTbalh2RQmEmfvwNApstfUgPC6Mo/LrhHNXIL73kwXeZWcWpH2XzZncltP 3hU56Ek65O2ttcHv1mHObvP/Q8i+NlVq0x8hiKY/bLZT5rFzl9gE94ZQaFi3kYKoWIxJ FdwGr8gvt8zvGBNPWXx9Kbq1icBLzTuWEy8GfvbK3NaFaqX4z9YsBQTUSY8T5WDxSnKv 8bJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="wBn1/vKi"; 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 a23si10356896ejk.229.2020.09.22.03.53.49; Tue, 22 Sep 2020 03:54:12 -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="wBn1/vKi"; 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 S1726549AbgIVKwo (ORCPT + 99 others); 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 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. 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; -- 2.17.1