LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
To: David Laight <David.Laight@ACULAB.COM>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Vitaly Chikunov <vt@altlinux.org>,
	Eric Biggers <ebiggers@google.com>,
	Eric Biggers <ebiggers@kernel.org>,
	Gilad Ben-Yossef <gilad@benyossef.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	"Markku-Juhani O . Saarinen" <mjos@iki.fi>,
	Jussi Kivilinna <jussi.kivilinna@iki.fi>,
	Will Deacon <will@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jia Zhang <zhang.jia@linux.alibaba.com>,
	"YiLin . Li" <YiLin.Li@linux.alibaba.com>
Subject: Re: [PATCH 0/2] add AES-NI/AVX2/x86_64 implementation
Date: Sun, 22 Aug 2021 13:20:06 +0800	[thread overview]
Message-ID: <ea63cb91-dba8-9ac6-9ca7-967355e6236f@linux.alibaba.com> (raw)
In-Reply-To: <f7684dd9dc5e4c6081ba8e51f53e0844@AcuMS.aculab.com>

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

  reply	other threads:[~2021-08-22  5:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  3:31 Tianjia Zhang
2021-08-18  3:31 ` [PATCH 1/2] crypto: x86/sm4 - export reusable AESNI/AVX functions Tianjia Zhang
2021-08-18  3:31 ` [PATCH 2/2] crypto: x86/sm4 - add AES-NI/AVX2/x86_64 implementation Tianjia Zhang
2021-08-20 10:03 ` [PATCH 0/2] " David Laight
2021-08-22  5:20   ` Tianjia Zhang [this message]
2021-08-27  8:35 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea63cb91-dba8-9ac6-9ca7-967355e6236f@linux.alibaba.com \
    --to=tianjia.zhang@linux.alibaba.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=YiLin.Li@linux.alibaba.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=ebiggers@google.com \
    --cc=ebiggers@kernel.org \
    --cc=gilad@benyossef.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=jussi.kivilinna@iki.fi \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mjos@iki.fi \
    --cc=tglx@linutronix.de \
    --cc=vt@altlinux.org \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=zhang.jia@linux.alibaba.com \
    --subject='Re: [PATCH 0/2] add AES-NI/AVX2/x86_64 implementation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).