• Huang Ying's avatar
    crypto: cryptd - Per-CPU thread implementation based on kcrypto_wq · 254eff77
    Huang Ying authored
    Original cryptd thread implementation has scalability issue, this
    patch solve the issue with a per-CPU thread implementation.
    
    struct cryptd_queue is defined to be a per-CPU queue, which holds one
    struct cryptd_cpu_queue for each CPU. In struct cryptd_cpu_queue, a
    struct crypto_queue holds all requests for the CPU, a struct
    work_struct is used to run all requests for the CPU.
    
    Testing based on dm-crypt on an Intel Core 2 E6400 (two cores) machine
    shows 19.2% performance gain. The testing script is as follow:
    
    -------------------- script begin ---------------------------
    #!/bin/sh
    
    dmc_create()
    {
            # Create a crypt device using dmsetup
            dmsetup create $2 --table "0 `blockdev --getsize $1` crypt cbc(aes-asm)?cryptd?plain:plain babebabebabebabebabebabebabebabe 0 $1 0"
    }
    
    dmsetup remove crypt0
    dmsetup remove crypt1
    
    dd if=/dev/zero of=/dev/ram0 bs=1M count=4 >& /dev/null
    dd if=/dev/zero of=/dev/ram1 bs=1M count=4 >& /dev/null
    
    dmc...
    254eff77
cryptd.c 16.4 KB