diff options
author | Theodore Ts'o <tytso@mit.edu> | 2015-06-03 15:32:39 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-06-03 15:32:39 +0200 |
commit | 3dbb5eb9a3aa04f40e551338eee5e8d06f352fe8 (patch) | |
tree | c84bc425081af46b5692e437aa258adb0fe60846 /fs/ext4/ext4_crypto.h | |
parent | ext4 crypto: release crypto resource on module exit (diff) | |
download | linux-3dbb5eb9a3aa04f40e551338eee5e8d06f352fe8.tar.xz linux-3dbb5eb9a3aa04f40e551338eee5e8d06f352fe8.zip |
ext4 crypto: allocate bounce pages using GFP_NOWAIT
Previously we allocated bounce pages using a combination of
alloc_page() and mempool_alloc() with the __GFP_WAIT bit set.
Instead, use mempool_alloc() with GFP_NOWAIT. The mempool_alloc()
function will try using alloc_pages() initially, and then only use the
mempool reserve of pages if alloc_pages() is unable to fulfill the
request.
This minimizes the the impact on the mm layer when we need to do a
large amount of writeback of encrypted files, as Jaeguk Kim had
reported that under a heavy fio workload on a system with restricted
amounts memory (which unfortunately, includes many mobile handsets),
he had observed the the OOM killer getting triggered several times.
Using GFP_NOWAIT
If the mempool_alloc() function fails, we will retry the page
writeback at a later time; the function of the mempool is to ensure
that we can writeback at least 32 pages at a time, so we can more
efficiently dispatch I/O under high memory pressure situations. In
the future we should make this be a tunable so we can determine the
best tradeoff between permanently sequestering memory and the ability
to quickly launder pages so we can free up memory quickly when
necessary.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4_crypto.h')
-rw-r--r-- | fs/ext4/ext4_crypto.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/ext4_crypto.h b/fs/ext4/ext4_crypto.h index 34e0d2455881..ac7d4e813796 100644 --- a/fs/ext4/ext4_crypto.h +++ b/fs/ext4/ext4_crypto.h @@ -83,8 +83,7 @@ struct ext4_crypt_info { }; #define EXT4_CTX_REQUIRES_FREE_ENCRYPT_FL 0x00000001 -#define EXT4_BOUNCE_PAGE_REQUIRES_FREE_ENCRYPT_FL 0x00000002 -#define EXT4_WRITE_PATH_FL 0x00000004 +#define EXT4_WRITE_PATH_FL 0x00000002 struct ext4_crypto_ctx { union { |