From e4e93083103df3c8b3957e06212e4b5186d071f7 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 18 Apr 2013 18:38:03 +0200 Subject: [PATCH] if: improve performance of big bio requests Writethrough of bio requests having more than one biovec should only sync the last one. The others will be written to the transaction log anyway. No need to wait for each of them to be committed one by one. --- kernel/mars_if.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kernel/mars_if.c b/kernel/mars_if.c index 67721b49..d75d6859 100644 --- a/kernel/mars_if.c +++ b/kernel/mars_if.c @@ -519,9 +519,14 @@ if_make_request(struct request_queue *q, struct bio *bio) mref_a->orig_biow[0] = biow; mref_a->bio_count = 1; assigned = true; - - if (do_skip_sync) { - mref->ref_skip_sync = true; + + /* When a bio with multiple biovecs is split into + * multiple mrefs, only the last one should be + * working in synchronous writethrough mode. + */ + mref->ref_skip_sync = true; + if (!do_skip_sync && i + 1 >= bio->bi_vcnt) { + mref->ref_skip_sync = false; } atomic_inc(&input->plugged_count);