aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkback/common.h
diff options
context:
space:
mode:
authorBob Liu <bob.liu@oracle.com>2015-11-13 22:12:19 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2016-01-04 12:21:06 -0500
commitd4bf0065b7251afb723a29b2fd58f7c38f8ce297 (patch)
tree89b6ecb159f7dccd22ac1511388b589d3b424837 /drivers/block/xen-blkback/common.h
parentd62d86000316d7ef38e1c2e9602c3ce6d1cb57bd (diff)
xen/blkback: make pool of persistent grants and free pages per-queue
Make pool of persistent grants and free pages per-queue/ring instead of per-device to get better scalability. Test was done based on null_blk driver: dom0: v4.2-rc8 16vcpus 10GB "modprobe null_blk" domu: v4.2-rc8 16vcpus 10GB [test] rw=read direct=1 ioengine=libaio bs=4k time_based runtime=30 filename=/dev/xvdb numjobs=16 iodepth=64 iodepth_batch=64 iodepth_batch_complete=64 group_reporting Results: iops1: After patch "xen/blkfront: make persistent grants per-queue". iops2: After this patch. Queues: 1 4 8 16 Iops orig(k): 810 1064 780 700 Iops1(k): 810 1230(~20%) 1024(~20%) 850(~20%) Iops2(k): 810 1410(~35%) 1354(~75%) 1440(~100%) With 4 queues after this commit we can get ~75% increase in IOPS, and performance won't drop if increasing queue numbers. Please find the respective chart in this link: https://www.dropbox.com/s/agrcy2pbzbsvmwv/iops.png?dl=0 Signed-off-by: Bob Liu <bob.liu@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.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index 847444dc1df4..3c244ecf22a4 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -291,6 +291,22 @@ struct xen_blkif_ring {
291 spinlock_t pending_free_lock; 291 spinlock_t pending_free_lock;
292 wait_queue_head_t pending_free_wq; 292 wait_queue_head_t pending_free_wq;
293 293
294 /* Tree to store persistent grants. */
295 spinlock_t pers_gnts_lock;
296 struct rb_root persistent_gnts;
297 unsigned int persistent_gnt_c;
298 atomic_t persistent_gnt_in_use;
299 unsigned long next_lru;
300
301 /* Used by the kworker that offload work from the persistent purge. */
302 struct list_head persistent_purge_list;
303 struct work_struct persistent_purge_work;
304
305 /* Buffer of free pages to map grant refs. */
306 spinlock_t free_pages_lock;
307 int free_pages_num;
308 struct list_head free_pages;
309
294 struct work_struct free_work; 310 struct work_struct free_work;
295 /* Thread shutdown wait queue. */ 311 /* Thread shutdown wait queue. */
296 wait_queue_head_t shutdown_wq; 312 wait_queue_head_t shutdown_wq;
@@ -312,22 +328,6 @@ struct xen_blkif {
312 struct completion drain_complete; 328 struct completion drain_complete;
313 atomic_t drain; 329 atomic_t drain;
314 330
315 /* tree to store persistent grants */
316 spinlock_t pers_gnts_lock;
317 struct rb_root persistent_gnts;
318 unsigned int persistent_gnt_c;
319 atomic_t persistent_gnt_in_use;
320 unsigned long next_lru;
321
322 /* used by the kworker that offload work from the persistent purge */
323 struct list_head persistent_purge_list;
324 struct work_struct persistent_purge_work;
325
326 /* buffer of free pages to map grant refs */
327 spinlock_t free_pages_lock;
328 int free_pages_num;
329 struct list_head free_pages;
330
331 /* statistics */ 331 /* statistics */
332 unsigned long st_print; 332 unsigned long st_print;
333 unsigned long long st_rd_req; 333 unsigned long long st_rd_req;