From: David Vrabel <david.vrabel@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: <xen-devel@lists.xen.org>, <linux-kernel@vger.kernel.org>,
David Vrabel <david.vrabel@citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen-blkback: use bigger array for batch gnt operations
Date: Thu, 1 Aug 2013 13:30:36 +0100 [thread overview]
Message-ID: <51FA54EC.6030604@citrix.com> (raw)
In-Reply-To: <1375358934-6335-1-git-send-email-roger.pau@citrix.com>
On 01/08/13 13:08, Roger Pau Monne wrote:
> Right now the maximum number of grant operations that can be batched
> in a single request is BLKIF_MAX_SEGMENTS_PER_REQUEST (11). This was
> OK before indirect descriptors because the maximum number of segments
> in a request was 11, but with the introduction of indirect
> descriptors the maximum number of segments in a request has been
> increased past 11.
>
> The memory used by the structures that are passed in the hypercall was
> allocated from the stack, but if we have to increase the size of the
> array we can no longer use stack memory, so we have to pre-allocate
> it.
>
> This patch increases the maximum size of batch grant operations and
> replaces the use of stack memory with pre-allocated memory, that is
> reserved when the blkback instance is initialized.
[...]
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
[...]
> @@ -148,6 +155,16 @@ static struct xen_blkif *xen_blkif_alloc(domid_t domid)
> if (!req->indirect_pages[j])
> goto fail;
> }
> + req->map = kcalloc(GNT_OPERATIONS_SIZE, sizeof(req->map[0]), GFP_KERNEL);
> + if (!req->map)
> + goto fail;
> + req->unmap = kcalloc(GNT_OPERATIONS_SIZE, sizeof(req->unmap[0]), GFP_KERNEL);
> + if (!req->unmap)
> + goto fail;
> + req->pages_to_gnt = kcalloc(GNT_OPERATIONS_SIZE, sizeof(req->pages_to_gnt[0]),
> + GFP_KERNEL);
> + if (!req->pages_to_gnt)
> + goto fail;
Do these need to be per-request? Or can they all share a common set of
arrays?
David
next prev parent reply other threads:[~2013-08-01 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 12:08 [PATCH] xen-blkback: use bigger array for batch gnt operations Roger Pau Monne
2013-08-01 12:30 ` David Vrabel [this message]
2013-08-01 14:18 ` [Xen-devel] " Roger Pau Monné
2013-08-26 14:34 ` Roger Pau Monné
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=51FA54EC.6030604@citrix.com \
--to=david.vrabel@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roger.pau@citrix.com \
--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