Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3758189pxk; Tue, 22 Sep 2020 01:32:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDY8iudfcRfNaGpQFYxKiMJiEMxBE/4Ek4CHwY/QsGKoiZvHZ2yWrznwlXJnyavFseQk42 X-Received: by 2002:aa7:de03:: with SMTP id h3mr2804675edv.232.1600763549985; Tue, 22 Sep 2020 01:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600763549; cv=none; d=google.com; s=arc-20160816; b=KLhDV+rRx74FVDv8yB+ne7bK8HjYXO8rAHrIg7NkOeDqqqNd2KkoaWUCggrRSOfIZs TK7G9qIoQPi7KsrRFOd7MLyUq3no0i3XZBzZ8ITFFYxIbqVxdP2zka+wQFceOfl3b8B7 0KA2ARzZEfiHTbsitj8skZAhstiLaQf78k4SjVmkrK7assPu7mMaX8IZ2ZYDpm8bGsZu HJ0i0TlvMCyseGcFC3QBVR9LDkZaWnPohu2y8m53HvTaApbZh5rMTLH5VpT4iBrfUu1H V7vSkUqMD6R73B/Jw7j1oEJfxDUDYsHxs3PhAGB4FWEk79LpfkWgUc5MOO3YGyQIcHaA F3FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=BO349OSC4lsV1EmHanwtHybcd2v8aj+SOer8QAK+bYY=; b=H3fV9cNvQoz6yEH0z1ulFaXhvz8FxLoPf64wPhe2C3hrOEmhuTTMGkxIo7NdcJFQwT ftuDVPiMIh1XPDCR635XkRr4AHDUODR4Raq5V//QQzAR+nl7mphagwzkOJemZoC4kryN iWxYD/MG8ui+NZwEVkaGjwNhNHgq0SDYRn10jiPtZYfhwuvmrXmT7ieAYn751M8B4myY X4Wp3a5eGCYuBllwBxw5YFdJvvAt4ag4ky9gyAEjJZsDgL8XMH/sC10QJXLbh20BnWGs E6zgFcysplk9LF5JRJtrlT+7mYqygJyiV3CQk6hLJLJqwaLvn8xo1BHULTLDJgx8sPix o20A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=LHgQEQbd; 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 dp9si9675498ejc.203.2020.09.22.01.32.06; Tue, 22 Sep 2020 01:32:29 -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=LHgQEQbd; 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 S1729610AbgIVHCP (ORCPT + 99 others); Tue, 22 Sep 2020 03:02:15 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:60972 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729168AbgIVHCP (ORCPT ); Tue, 22 Sep 2020 03:02:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1600758136; x=1632294136; h=from:to:cc:subject:date:message-id:mime-version; bh=BO349OSC4lsV1EmHanwtHybcd2v8aj+SOer8QAK+bYY=; b=LHgQEQbdbG6JkTGizBbYQXIB2o+I5VTBhFn8d62hrmu4KkNxUpAKFJVt j9vO4MjvB0Mn/7UZFJokyNi/7FOhk3KAN7d+YomvLW+0vSyJ9wvndB5Nd aSIts4KWdw6h5N2lT3DlZmoYSYKOMb8LMfRKiqUggGyHqwUKG75IucR9B c=; X-IronPort-AV: E=Sophos;i="5.77,289,1596499200"; d="scan'208";a="70008820" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1a-67b371d8.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 22 Sep 2020 07:01:54 +0000 Received: from EX13D31EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1a-67b371d8.us-east-1.amazon.com (Postfix) with ESMTPS id D006AA44C3; Tue, 22 Sep 2020 07:01:51 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.160.185) by EX13D31EUA004.ant.amazon.com (10.43.165.161) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 07:01:46 +0000 From: SeongJae Park To: , CC: SeongJae Park , , , , , , , Subject: [PATCH] xen-blkback: add a parameter for disabling of persistent grants Date: Tue, 22 Sep 2020 09:01:25 +0200 Message-ID: <20200922070125.27251-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.185] X-ClientProxiedBy: EX13D11UWB001.ant.amazon.com (10.43.161.53) 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 overhead[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 | 8 ++++++++ drivers/block/xen-blkback/xenbus.c | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-driver-xen-blkback b/Documentation/ABI/testing/sysfs-driver-xen-blkback index ecb7942ff146..0c42285c75ee 100644 --- a/Documentation/ABI/testing/sysfs-driver-xen-blkback +++ b/Documentation/ABI/testing/sysfs-driver-xen-blkback @@ -35,3 +35,11 @@ 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. + The default is 1 (enable). diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index b9aa5d1ac10b..9c03d70469f4 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 unsigned int feature_persistent = 1; +module_param_named(feature_persistent, feature_persistent, int, 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,7 +912,8 @@ 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); + err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u", + feature_persistent ? 1 : 0); if (err) { xenbus_dev_fatal(dev, err, "writing %s/feature-persistent", dev->nodename); @@ -1093,8 +1100,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