Linux-ext4 Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 0/3] ext4: Prevent memory reclaim from re-entering the filesystem and deadlocking
@ 2019-12-27  8:05 Naoto Kobayashi
  2019-12-27  8:05 ` [PATCH v2 1/3] ext4: Delete ext4_kvzvalloc() Naoto Kobayashi
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Naoto Kobayashi @ 2019-12-27  8:05 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: Naoto Kobayashi, linux-ext4

This series aims to prevent ext4_kvmalloc() from re-entering
the filesystem and deadlocking. Although __vmalloc() doesn't
support GFP_NOFS[1], all of the user of ext4_kvmalloc are using
GFP_NOFS (e.g. fs/ext4/resize.c::add_new_gdb), causing the memory
reclaim to re-enter the filesystem.

To fix this issue, use memalloc_nfs_save/restore() that get
__vmalloc() to drop __GFP_FS.

[1] linux-tree/Documentation/core-api/gfp-mask-fs-io.rst

Changes since v1:
  - Add Patch 1 to delete ext4_kvzvalloc() that is not used anywhere.
  - Add Patch 2 to rename ext4_kvmalloc() to ext4_kvmalloc_nofs() and
    drop its flags argument since all the users of ext4_kvmalloc() are
    using GFP_NOFS

Thanks,


Naoto Kobayashi (3):
  ext4: Delete ext4_kvzvalloc()
  ext4: Rename ext4_kvmalloc() to ext4_kvmalloc_nofs() and drop its
    flags argument
  ext4: Prevent ext4_kvmalloc_nofs() from re-entering the filesystem and
    deadlocking

 fs/ext4/ext4.h   |  3 +--
 fs/ext4/resize.c | 10 ++++------
 fs/ext4/super.c  | 21 +++++++--------------
 fs/ext4/xattr.c  |  2 +-
 4 files changed, 13 insertions(+), 23 deletions(-)


--
2.16.6


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, back to index

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27  8:05 [PATCH v2 0/3] ext4: Prevent memory reclaim from re-entering the filesystem and deadlocking Naoto Kobayashi
2019-12-27  8:05 ` [PATCH v2 1/3] ext4: Delete ext4_kvzvalloc() Naoto Kobayashi
2020-01-09  9:51   ` Jan Kara
2020-01-13 22:32   ` Theodore Y. Ts'o
2019-12-27  8:05 ` [PATCH v2 2/3] ext4: Rename ext4_kvmalloc() to ext4_kvmalloc_nofs() and drop its flags argument Naoto Kobayashi
2020-01-09 10:00   ` Jan Kara
2020-01-13 22:32   ` Theodore Y. Ts'o
2020-01-16 12:37     ` Jan Kara
2020-01-16 15:12       ` Theodore Y. Ts'o
2020-01-16 15:50         ` [PATCH] ext4: drop ext4_kvmalloc() Theodore Ts'o
2020-01-17 10:30           ` Jan Kara
2020-01-17 16:36             ` Theodore Y. Ts'o
2019-12-27  8:05 ` [PATCH v2 3/3] ext4: Prevent ext4_kvmalloc_nofs() from re-entering the filesystem and deadlocking Naoto Kobayashi

Linux-ext4 Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ext4/0 linux-ext4/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ext4 linux-ext4/ https://lore.kernel.org/linux-ext4 \
		linux-ext4@vger.kernel.org
	public-inbox-index linux-ext4

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ext4


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git