Commit 75177faa authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] reduce CPU cost in loop

balance_dirty_pages() is too expensive to call once-per-page.  Use the
ratelimited version.
parent 5e1341d1
......@@ -238,7 +238,7 @@ do_lo_send(struct loop_device *lo, struct bio_vec *bvec, int bsize, loff_t pos)
up(&mapping->host->i_sem);
out:
kunmap(bvec->bv_page);
balance_dirty_pages(mapping);
balance_dirty_pages_ratelimited(mapping);
return ret;
unlock:
......
......@@ -166,7 +166,6 @@ void balance_dirty_pages(struct address_space *mapping)
if (!writeback_in_progress(bdi) && ps.nr_dirty > background_thresh)
pdflush_operation(background_writeout, 0);
}
EXPORT_SYMBOL_GPL(balance_dirty_pages);
/**
* balance_dirty_pages_ratelimited - balance dirty memory state
......@@ -200,6 +199,7 @@ void balance_dirty_pages_ratelimited(struct address_space *mapping)
}
put_cpu();
}
EXPORT_SYMBOL_GPL(balance_dirty_pages_ratelimited);
/*
* writeback at least _min_pages, and keep writing until the amount of dirty
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment