From: "Roger Pau Monné" <roger.pau@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: <xen-devel@lists.xen.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen-blkback: use bigger array for batch gnt operations
Date: Thu, 1 Aug 2013 16:18:54 +0200 [thread overview]
Message-ID: <51FA6E4E.2080001@citrix.com> (raw)
In-Reply-To: <51FA54EC.6030604@citrix.com>
On 01/08/13 14:30, David Vrabel wrote:
> 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?
No, we cannot share them unless we serialize the unmap of grants using a
spinlock (like we do when writing the reponse on the ring).
next prev parent reply other threads:[~2013-08-01 14:18 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 ` [Xen-devel] " David Vrabel
2013-08-01 14:18 ` Roger Pau Monné [this message]
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=51FA6E4E.2080001@citrix.com \
--to=roger.pau@citrix.com \
--cc=david.vrabel@citrix.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