]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen-blkback: move indirect req allocation out-of-line
authorAnkur Arora <ankur.a.arora@oracle.com>
Thu, 4 Jan 2018 12:41:03 +0000 (07:41 -0500)
committerAnkur Arora <ankur.a.arora@oracle.com>
Wed, 17 Jan 2018 17:59:44 +0000 (12:59 -0500)
commitf0af2f840606bcdf15fb1384b94d9bb477d76a7f
tree9c7c7094a09137a4508efeb7c08ac597e14c4fed
parent8346c3f56b88b405ad17ebb543a973c3ed8443d5
xen-blkback: move indirect req allocation out-of-line

struct pending_req is allocated ahead-of-time (in connect_ring())
for each ring slot. This is potentially a large number of allocations
(number-of-queues * ring-slots) and given that the structure is sized
for the worst case (MAX_INDIRECT_SEGMENTS), each element is 16616 bytes
on 64-bit.

The allocation itself is via kmalloc so this becomes multiple order-3
allocations for each vbd.

This patch slims down the structure by limiting the pre-allocated
structures to BLKIF_MAX_SEGMENTS_PER_REQUEST. Requests larger than
this are allocated dynamically. On my machine (E5-2660 0 @ 2.20GHz),
without any memory pressure, this adds an average of about 1us to do
the indirect allocation path.

Orabug: 26670475

Suggested-by: Bhavesh Davda <bhavesh.davda@oracle.com>
Reviewed-by: Bhavesh Davda <bhavesh.davda@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
drivers/block/xen-blkback/blkback.c
drivers/block/xen-blkback/xenbus.c