Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3976683pxk; Tue, 22 Sep 2020 07:28:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP/3TnE+QG9ntJT/A8u6HwUApAJDvUFK09yC+9IjyHzB9nwS8GDY+Ae8athstYi28iAZFE X-Received: by 2002:a17:906:4c81:: with SMTP id q1mr5123324eju.72.1600784925135; Tue, 22 Sep 2020 07:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600784925; cv=none; d=google.com; s=arc-20160816; b=NXsPyXiQgHCRKjONZfDxGoryvXLwPyyX69c8UXTaqdEu9IZWPCFpgsH8UsC1272SYI hUU9800Oy2Mdb95DM9JVmwIcPHYbYKY/RBwlcBAu9cMSZ34rhT0PZ0N5OQeafcY4wI2S yvvNF88j11j8ChkLvwV3UkeXxib2YCpygtd/Gn4iXYM7XMGTdPDpuTwla2FwnIKYT9IX cyTOpSP5W82AUcbX7wNvCuoLMSxooodnfz+0qpuRI2gNMlRecMp479oCq81tvT1EuQq9 /2E0TjEx9EMBAMwLMo7FhRw11hxDjreBNrFzHDKZ857Nxld08A5Req3087FEmsB69379 70DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=9iap8OhR0mg2o+oQKvKr4dqpchp5k/Qdg/nP8obFaeY=; b=FC5iIiqaudzLxr4pSxPmGEymYXeqN20f6mjdWfev1UuiTS4eaZ9Ht0emVUc0pkxf0E vRccp1jchqswWQlpXsH2Hy5D6F+FELV/Nc5yfk3NleTpofYM7LLDopIwHotl143NZ+c3 MEs1/wamMh+X0qr2R9waILWzyKMod6E+O8FKuxCR7ePsSa8aCRcZhlilE/+tLKvMxcMr 30miOofXw6xI4co9K3qC0vq7Zi+jr77XATXcIYEXjwy5P/F29KH7OnX8XQOrgTIJfsb9 5fm9PoK9eKB3wg7gKgf99nEjcfqnIRa5UiphTjIQPeuRcPKEPJRHzmiYIOqZjJpxyAEE fDcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="lHK/Q++s"; 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=NONE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pj11si10546369ejb.191.2020.09.22.07.28.20; Tue, 22 Sep 2020 07:28:45 -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=@suse.com header.s=susede1 header.b="lHK/Q++s"; 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=NONE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726627AbgIVO1H (ORCPT + 99 others); Tue, 22 Sep 2020 10:27:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:35314 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbgIVO1G (ORCPT ); Tue, 22 Sep 2020 10:27:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1600784824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9iap8OhR0mg2o+oQKvKr4dqpchp5k/Qdg/nP8obFaeY=; b=lHK/Q++sNDhMHjfjX0PVnGHzyRr4Dmz3rwSIx27UoO/Z2Lj7DKxvtEhgyNqSf7AL0BiHPY BnikXzfUR6ktJG5L0tmT+M/3qlgufoXtAj7UgEbRcdZR+58CVor2HlmziILdD7UNQ5Zca+ LEbsS7eQ/iOnCbOuuBlh2e6jVGEqbaE= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 39C7EAD20; Tue, 22 Sep 2020 14:27:41 +0000 (UTC) Subject: Re: [PATCH v3 2/3] xen-blkfront: add a parameter for disabling of persistent grants To: SeongJae Park , konrad.wilk@oracle.com, roger.pau@citrix.com Cc: SeongJae Park , axboe@kernel.dk, aliguori@amazon.com, amit@kernel.org, mheyne@amazon.de, pdurrant@amazon.co.uk, linux-block@vger.kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org References: <20200922141549.26154-1-sjpark@amazon.com> <20200922141549.26154-3-sjpark@amazon.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: <28773bff-7664-99fa-a542-b87e907bf705@suse.com> Date: Tue, 22 Sep 2020 16:27:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200922141549.26154-3-sjpark@amazon.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.09.20 16:15, 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 | 20 ++++++++++++++----- > 2 files changed, 24 insertions(+), 5 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..b2d3b1262404 100644 > --- a/drivers/block/xen-blkfront.c > +++ b/drivers/block/xen-blkfront.c > @@ -1866,8 +1866,8 @@ 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); > + err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u", > + info->feature_persistent); > if (err) > dev_warn(&dev->dev, > "writing persistent grants feature to xenbus"); > @@ -1941,6 +1941,13 @@ static int negotiate_mq(struct blkfront_info *info) > } > return 0; > } > + > +/* 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"); > + > /** > * Entry point to this code when a new device is created. Allocate the basic > * structures and the ring buffer for communication with the backend, and > @@ -2007,6 +2014,8 @@ static int blkfront_probe(struct xenbus_device *dev, > info->vdevice = vdevice; > info->connected = BLKIF_STATE_DISCONNECTED; > > + info->feature_persistent = feature_persistent ? 1 : 0; Just use the value. With that changed: Reviewed-by: Juergen Gross Juergen