]> git.baikalelectronics.ru Git - kernel.git/commit
dm crypt: scale to multiple cpus
authorAndi Kleen <ak@linux.intel.com>
Thu, 13 Jan 2011 19:59:53 +0000 (19:59 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 13 Jan 2011 19:59:53 +0000 (19:59 +0000)
commitaf159d1dbd9cf92d31a8e4a495a62a231d13bef1
treef97dc6534b0d3af9447002fe7d08ff25dfffed92
parentce380a6904e3aebc1fec8474c3a1fa32e720ade9
dm crypt: scale to multiple cpus

Currently dm-crypt does all the encryption work for a single dm-crypt
mapping in a single workqueue. This does not scale well when multiple
CPUs are submitting IO at a high rate. The single CPU running the single
thread cannot keep up with the encryption and encrypted IO performance
tanks.

This patch changes the crypto workqueue to be per CPU. This means
that as long as the IO submitter (or the interrupt target CPUs
for reads) runs on different CPUs the encryption work will be also
parallel.

To avoid a bottleneck on the IO worker I also changed those to be
per-CPU threads.

There is still some shared data, so I suspect some bouncing
cache lines. But I haven't done a detailed study on that yet.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-crypt.c