From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v1 2/7] xen-blkback: use balloon pages for all mappings
Date: Mon, 15 Apr 2013 10:21:20 +0200 [thread overview]
Message-ID: <516BB880.1010304@citrix.com> (raw)
In-Reply-To: <20130409154601.GD3158@phenom.dumpdata.com>
On 09/04/13 17:46, Konrad Rzeszutek Wilk wrote:
> On Wed, Mar 27, 2013 at 12:10:38PM +0100, Roger Pau Monne wrote:
>> Using balloon pages for all granted pages allows us to simplify the
>> logic in blkback, especially in the xen_blkbk_map function, since now
>> we can decide if we want to map a grant persistently or not after we
>> have actually mapped it. This could not be done before because
>> persistent grants used ballooned pages, whereas non-persistent grants
>> used pages from the kernel.
>>
>> This patch also introduces several changes, the first one is that the
>> list of free pages is no longer global, now each blkback instance has
>> it's own list of free pages that can be used to map grants. Also, a
>> run time parameter (max_buffer_pages) has been added in order to tune
>> the maximum number of free pages each blkback instance will keep in
>> it's buffer.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>> Cc: xen-devel@lists.xen.org
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> ---
>> Changes since RFC:
>> * Fix typos in commit message.
>> * Minor fixes in code.
>> ---
>> Documentation/ABI/stable/sysfs-bus-xen-backend | 8 +
>> drivers/block/xen-blkback/blkback.c | 265 +++++++++++++-----------
>> drivers/block/xen-blkback/common.h | 5 +
>> drivers/block/xen-blkback/xenbus.c | 3 +
>> 4 files changed, 165 insertions(+), 116 deletions(-)
>>
>> diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
>> index 3d5951c..e04afe0 100644
>> --- a/Documentation/ABI/stable/sysfs-bus-xen-backend
>> +++ b/Documentation/ABI/stable/sysfs-bus-xen-backend
>> @@ -73,3 +73,11 @@ KernelVersion: 3.0
>> Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Description:
>> Number of sectors written by the frontend.
>> +
>> +What: /sys/module/xen_blkback/parameters/max_buffer_pages
>> +Date: March 2013
>> +KernelVersion: 3.10
>> +Contact: Roger Pau Monné <roger.pau@citrix.com>
>> +Description:
>> + Maximum number of free pages to keep in each block
>> + backend buffer.
>> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
>> index f7526db..8a1892a 100644
>> --- a/drivers/block/xen-blkback/blkback.c
>> +++ b/drivers/block/xen-blkback/blkback.c
>> @@ -63,6 +63,21 @@ static int xen_blkif_reqs = 64;
>> module_param_named(reqs, xen_blkif_reqs, int, 0);
>> MODULE_PARM_DESC(reqs, "Number of blkback requests to allocate");
>>
>> +/*
>> + * Maximum number of unused free pages to keep in the internal buffer.
>> + * Setting this to a value too low will reduce memory used in each backend,
>> + * but can have a performance penalty.
>> + *
>> + * A sane value is xen_blkif_reqs * BLKIF_MAX_SEGMENTS_PER_REQUEST, but can
>> + * be set to a lower value that might degrade performance on some intensive
>> + * IO workloads.
>> + */
>> +
>> +static int xen_blkif_max_buffer_pages = 704;
>> +module_param_named(max_buffer_pages, xen_blkif_max_buffer_pages, int, 0644);
>> +MODULE_PARM_DESC(max_buffer_pages,
>> +"Maximum number of free pages to keep in each block backend buffer");
>
>
> Just curios but have you tried setting it to zero and seen what it does? Or
> to 1390193013910923?
I have not tried it, but setting it to 0 will just mean that we clean
the buffer of unused balloon pages at every iteration of
xen_blkif_schedule, which implies a performance degradation. On the
other hand, setting it to 1390193013910923 will mean that the buffer is
possibly never cleaned, so we could have RING_SIZE * MAX_SEGMENTS unused
balloon pages in the buffer, shouldn't be harmful either if the system
has enough memory.
>
> It might be good to actually have some code to check for sane values.
>
> <sigh> But obviously we did not do that with the xen_blkif_reqs option at all
> so this is capricious of me to ask you to do that in this patchset.
>
> But if you do find some extra time and want to send out a patch to make
> this more robust, that would be much appreciated. It does not have
> to be done now or with this patchset of course.
Instead of using xen_blkif_max_buffer_pages directly we could use
something similar to:
min(xen_blkif_max_buffer_pages, (RING_SIZE * MAX_SEGMENTS))
next prev parent reply other threads:[~2013-04-15 8:21 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 11:10 [PATCH v1 0/7] xen-block: indirect descriptors Roger Pau Monne
2013-03-27 11:10 ` [PATCH v1 1/7] xen-blkback: print stats about persistent grants Roger Pau Monne
2013-04-09 14:47 ` Konrad Rzeszutek Wilk
2013-03-27 11:10 ` [PATCH v1 2/7] xen-blkback: use balloon pages for all mappings Roger Pau Monne
2013-04-09 14:47 ` Konrad Rzeszutek Wilk
2013-04-15 8:05 ` Roger Pau Monné
2013-04-15 8:12 ` [Xen-devel] " Roger Pau Monné
2013-04-17 14:00 ` Konrad Rzeszutek Wilk
2013-04-15 9:14 ` Roger Pau Monné
2013-04-17 14:05 ` Konrad Rzeszutek Wilk
2013-04-09 15:46 ` Konrad Rzeszutek Wilk
2013-04-15 8:21 ` Roger Pau Monné [this message]
2013-03-27 11:10 ` [PATCH v1 3/7] xen-blkback: implement LRU mechanism for persistent grants Roger Pau Monne
2013-04-09 15:42 ` Konrad Rzeszutek Wilk
2013-04-15 11:19 ` Roger Pau Monné
2013-04-17 14:15 ` Konrad Rzeszutek Wilk
2013-03-27 11:10 ` [PATCH v1 4/7] xen-blkback: move pending handles list from blkbk to pending_req Roger Pau Monne
2013-03-27 11:10 ` [PATCH v1 5/7] xen-blkback: make the queue of free requests per backend Roger Pau Monne
2013-04-09 16:13 ` Konrad Rzeszutek Wilk
2013-04-15 13:50 ` Roger Pau Monné
2013-04-17 14:16 ` Konrad Rzeszutek Wilk
2013-03-27 11:10 ` [PATCH v1 6/7] xen-blkback: expand map/unmap functions Roger Pau Monne
2013-03-27 11:10 ` [PATCH v1 7/7] xen-block: implement indirect descriptors Roger Pau Monne
2013-04-09 18:49 ` Konrad Rzeszutek Wilk
2013-04-15 17:01 ` Roger Pau Monné
2013-04-17 14:25 ` Konrad Rzeszutek Wilk
2013-04-17 17:04 ` Roger Pau Monné
2013-04-17 17:27 ` Konrad Rzeszutek Wilk
2013-04-18 12:43 ` Jens Axboe
2013-04-18 14:16 ` Roger Pau Monné
2013-04-18 14:26 ` Jens Axboe
2013-04-18 15:14 ` Roger Pau Monné
2013-04-18 15:58 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=516BB880.1010304@citrix.com \
--to=roger.pau@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox