linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, linux-crypto@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, ecryptfs@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] crypto: allow to assign gfp_t for __crypto_alloc_tfm
Date: Mon, 18 May 2015 23:24:30 -0700	[thread overview]
Message-ID: <20150519062430.GA39588@jaegeuk-mac02.hsd1.ca.comcast.net> (raw)
In-Reply-To: <20150519054945.GA28060@gondor.apana.org.au>

On Tue, May 19, 2015 at 01:49:45PM +0800, Herbert Xu wrote:
> On Mon, May 18, 2015 at 10:46:56PM -0700, Jaegeuk Kim wrote:
> > This patch adds a parameter, gfp_t, for __crypto_alloc_tfm.
> > Now EXT4 and F2FS use the crypto engine to encrypt a page when writing it to the
> > disk.
> > That happens during ->writepage and it needs to allocate memory with
> > GFP_NOFS.
> > 
> > Otherwise, in the f2fs case, kernel reports such the following warning.
> 
> Normally crypto structures should only be allocated on control
> paths where sleeping or swapping is not an issue.  Why is ext4
> doing crypto allocations on the data path?
> 

Recently, Ted introduced per-file encryption feature as follows.

https://lwn.net/Articles/639427/

The call path in fs/ext4/crypto.c is:
 - writepage
  - ext4_encrypt
   - ext4_get_crypto_ctx
    - crypto_alloc_ablkcipher

AFAIK, this way can achieve to reduce memory footprint gracefully.
Just before submitting bios, fs allocates the required memory, and then end_io
will free them in pair.

Thanks,

> 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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2015-05-19  6:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19  5:46 [PATCH] crypto: allow to assign gfp_t for __crypto_alloc_tfm Jaegeuk Kim
2015-05-19  5:49 ` Herbert Xu
2015-05-19  6:24   ` Jaegeuk Kim [this message]
2015-05-19  6:31     ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim
2015-05-19  6:32       ` Herbert Xu
2015-05-19  6:32     ` [PATCH] " Herbert Xu
2015-05-19  6:58       ` Jaegeuk Kim
2015-05-19  6:59         ` Herbert Xu
2015-05-19  7:13           ` Jaegeuk Kim
2015-05-19  7:15             ` Herbert Xu
2015-05-19  7:27               ` Jaegeuk Kim
2015-05-19  7:30                 ` Herbert Xu
2015-05-19  7:59                   ` Jaegeuk Kim
2015-05-19 14:14               ` Theodore Ts'o
2015-05-19 14:27                 ` Herbert Xu
2015-05-19 14:39                   ` Theodore Ts'o
2015-05-20  7:21                   ` Steffen Klassert
2015-05-20 14:59                     ` Theodore Ts'o
2015-05-20 15:30                       ` Ard Biesheuvel
2015-05-20 15:42                         ` 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=20150519062430.GA39588@jaegeuk-mac02.hsd1.ca.comcast.net \
    --to=jaegeuk@kernel.org \
    --cc=davem@davemloft.net \
    --cc=ecryptfs@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).