summaryrefslogtreecommitdiff
path: root/drivers/block/xen-blkback/common.h
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2013-05-02 12:21:17 +0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-05-07 17:42:17 +0400
commitbb642e8315fd573795e8b6fa9b9629064d73add1 (patch)
tree47ee834fb5a80a77129cb8bf0607ce4db9c04a55 /drivers/block/xen-blkback/common.h
parent402b27f9f2c22309d5bb285628765bc27b82fcf5 (diff)
downloadlinux-bb642e8315fd573795e8b6fa9b9629064d73add1.tar.xz
xen-blkback: allocate list of pending reqs in small chunks
Allocate pending requests in smaller chunks instead of allocating them all at the same time. This change also removes the global array of pending_reqs, it is no longer necessay. Variables related to the grant mapping have been grouped into a struct called "grant_page", this allows to allocate them in smaller chunks, and also improves memory locality. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reported-by: Sander Eikelenboom <linux@eikelenboom.it> Tested-by: Sander Eikelenboom <linux@eikelenboom.it> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block/xen-blkback/common.h')
-rw-r--r--drivers/block/xen-blkback/common.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index 1ac53da8410f..c6b4cb9af6c2 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -297,8 +297,6 @@ struct xen_blkif {
int free_pages_num;
struct list_head free_pages;
- /* Allocation of pending_reqs */
- struct pending_req *pending_reqs;
/* List of all 'pending_req' available */
struct list_head pending_free;
/* And its spinlock. */
@@ -323,6 +321,13 @@ struct seg_buf {
unsigned int nsec;
};
+struct grant_page {
+ struct page *page;
+ struct persistent_gnt *persistent_gnt;
+ grant_handle_t handle;
+ grant_ref_t gref;
+};
+
/*
* Each outstanding request that we've passed to the lower device layers has a
* 'pending_req' allocated to it. Each buffer_head that completes decrements
@@ -337,14 +342,9 @@ struct pending_req {
unsigned short operation;
int status;
struct list_head free_list;
- struct page *pages[MAX_INDIRECT_SEGMENTS];
- struct persistent_gnt *persistent_gnts[MAX_INDIRECT_SEGMENTS];
- grant_handle_t grant_handles[MAX_INDIRECT_SEGMENTS];
- grant_ref_t grefs[MAX_INDIRECT_SEGMENTS];
+ struct grant_page *segments[MAX_INDIRECT_SEGMENTS];
/* Indirect descriptors */
- struct persistent_gnt *indirect_persistent_gnts[MAX_INDIRECT_PAGES];
- struct page *indirect_pages[MAX_INDIRECT_PAGES];
- grant_handle_t indirect_handles[MAX_INDIRECT_PAGES];
+ struct grant_page *indirect_pages[MAX_INDIRECT_PAGES];
struct seg_buf seg[MAX_INDIRECT_SEGMENTS];
struct bio *biolist[MAX_INDIRECT_SEGMENTS];
};