Re: [PATCH 0/2] add AES-NI/AVX2/x86_64 implementation

From: Tianjia Zhang
Date: Sun Aug 22 2021 - 01:20:19 EST


Hi David,

On 8/20/21 6:03 PM, David Laight wrote:
From: Tianjia Zhang
Sent: 18 August 2021 04:31

This patchsets exported some of the common functions implemented by
the SM4 AESNI/AVX algorithm, and reused these functions to achieve
the acceleration of AESNI/AVX2 implementation.

These functions need bracketing by kernel_fpu_enable()
(or whatever it is called.)
That will significantly affect the performance.

Also the functions look pretty big (I don't know how big
the generic ones are) and will take time to load into the I$
and will displace other code.

So while a hot-cache benchmark might show improvements
for repeated calls is isn't obvious that any significant
gain will be made for real-life calls which could easily
be of single buffers.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


Yes, the functions bracketed by kernel_fpu_begin() do affect performance. It seems that the kernel can only do this, so by processing as much data as possible in a kernel_fpu_begin/end() operation to improve performance. actually do it now.

Best regards,
Tianjia