OSDN Git Service

dm crypt: offload writes to thread
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 13 Feb 2015 13:25:59 +0000 (08:25 -0500)
committerMike Snitzer <snitzer@redhat.com>
Mon, 16 Feb 2015 16:11:14 +0000 (11:11 -0500)
commitdc2676210c425ee8e5cb1bec5bc84d004ddf4179
tree2d38e1d74895e7cf419a0408805ed73673d69425
parent94f5e0243c48aa01441c987743dc468e2d6eaca2
dm crypt: offload writes to thread

Submitting write bios directly in the encryption thread caused serious
performance degradation.  On a multiprocessor machine, encryption requests
finish in a different order than they were submitted.  Consequently, write
requests would be submitted in a different order and it could cause severe
performance degradation.

Move the submission of write requests to a separate thread so that the
requests can be sorted before submitting.  But this commit improves
dm-crypt performance even without having dm-crypt perform request
sorting (in particular it enables IO schedulers like CFQ to sort more
effectively).

Note: it is required that a previous commit ("dm crypt: don't allocate
pages for a partial request") be applied before applying this patch.
Otherwise, this commit could introduce a crash.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-crypt.c