I'm developing a kernel module for VPN, and I decided to integrate AES-NI for AES cipher.
The platform is Linux with non-preemtible SMP kernel.
I writed a assembly code almost same as the code from AES-NI Sample Library prorivded by Intel.
Also I figured out I had to call kernel_fpu_begin() and kernel_fpu_end() to use AES-NI in kernel module.
The module I wrote operated well as the perspective of encryption/decryption operation.
Here is the Question.
I tested the module with set cpu affinity. I confirmed the performance was improved as I used more cpu cores until all cores used were in same CPU.
However, I use more cores including the cores in another CPU (totally I use two CPUs), the performance were degraded. How can I explain this situation? More cores, less performance??
My device has two CPUs (Intel Xeon CPU E5645).
Please give me an answer or any suggestion.
Thanks in advance.
Summary:
AES-NI in kernel module.
Non-preemptive SMP kernel.
With one CPU, looks good.
With two CPUs, worse performance than one CPU.
AES-NI performance degraded on SMP, Linux
Hi, I am a Intel instruction newbie, and I encountered a wired situation.


