Commit a7c3e62b authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Mike Snitzer

dm integrity: use plugging when writing the journal

When copying data from the journal to the appropriate place, we submit
many IOs.  Some of these IOs could go to adjacent areas.  Use on-stack
plugging so that adjacent IOs get merged during submission.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 9dd59727
...@@ -1823,6 +1823,9 @@ static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start, ...@@ -1823,6 +1823,9 @@ static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start,
{ {
unsigned i, j, n; unsigned i, j, n;
struct journal_completion comp; struct journal_completion comp;
struct blk_plug plug;
blk_start_plug(&plug);
comp.ic = ic; comp.ic = ic;
comp.in_flight = (atomic_t)ATOMIC_INIT(1); comp.in_flight = (atomic_t)ATOMIC_INIT(1);
...@@ -1947,6 +1950,8 @@ static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start, ...@@ -1947,6 +1950,8 @@ static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start,
dm_bufio_write_dirty_buffers_async(ic->bufio); dm_bufio_write_dirty_buffers_async(ic->bufio);
blk_finish_plug(&plug);
complete_journal_op(&comp); complete_journal_op(&comp);
wait_for_completion_io(&comp.comp); wait_for_completion_io(&comp.comp);
......
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