mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: Tadeusz Struk <tstruk@gmail.com>,
	Stephan Mueller <smueller@chronox.de>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: af_alg - add async support to algif_aead
Date: Thu, 21 Jan 2016 13:00:21 +0800	[thread overview]
Message-ID: <20160121050021.GA4826@gondor.apana.org.au> (raw)
In-Reply-To: <569FEB90.5020203@intel.com>

On Wed, Jan 20, 2016 at 12:18:24PM -0800, Tadeusz Struk wrote:
>
> I tried sock_kmalloc and it will not work. The sysctl_optmem_max by
> default is 20480 bytes. The aead ctx by itself takes more than half of
> it (11832 bytes). A single async request takes 11408 bytes.
> It means we need to use kmalloc or no async request could be allocated.
> I would opt to go with this version and I'll convert both algif_aead
> and algif_skcipher to use sock_hold later.

Then we have to make it smaller.  The whole point of this is to
stop the user from allocating too much kernel memory, and if you
are allocating too much memory to start with...

So instead of allocating RSGL_MAX_ENTRIES you should turn it into
a linked list like algif_skcipher and then allocate it on demand
using sock_kmalloc.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2016-01-21  5:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 19:21 Tadeusz Struk
2016-01-17 15:07 ` Stephan Mueller
2016-01-18 15:22   ` Tadeusz Struk
2016-01-19  0:34     ` Herbert Xu
2016-01-19 15:18       ` Tadeusz Struk
2016-01-20 20:18       ` Tadeusz Struk
2016-01-21  5:00         ` Herbert Xu [this message]
2016-01-27 22:10 Tadeusz Struk
2016-01-27 22:29 ` kbuild test robot
2016-01-27 22:41   ` Tadeusz Struk
2016-01-28  6:26 ` Stephan Mueller
2016-01-28 16:00   ` Tadeusz Struk
2016-01-28 17:09     ` Stephan Mueller
2016-01-28 17:30       ` Tadeusz Struk

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=20160121050021.GA4826@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smueller@chronox.de \
    --cc=tadeusz.struk@intel.com \
    --cc=tstruk@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®