• Andi Kleen's avatar
    dm crypt: scale to multiple cpus · c0297721
    Andi Kleen authored
    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: default avatarAndi Kleen <ak@linux.intel.com>
    Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    c0297721
dm-crypt.c 36.1 KB