The patch titled Subject: jbd2: make the whole kjournald2 kthread NOFS safe has been added to the -mm tree. Its filename is jbd2-make-the-whole-kjournald2-kthread-nofs-safe.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/jbd2-make-the-whole-kjournald2-kthread-nofs-safe.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/jbd2-make-the-whole-kjournald2-kthread-nofs-safe.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Michal Hocko <mhocko@xxxxxxxx> Subject: jbd2: make the whole kjournald2 kthread NOFS safe kjournald2 is central to the transaction commit processing. As such any potential allocation from this kernel thread has to be GFP_NOFS. Make sure to mark the whole kernel thread GFP_NOFS by the memalloc_nofs_save. Link: http://lkml.kernel.org/r/20170306131408.9828-8-mhocko@xxxxxxxxxx Signed-off-by: Michal Hocko <mhocko@xxxxxxxx> Suggested-by: Jan Kara <jack@xxxxxxx> Reviewed-by: Jan Kara <jack@xxxxxxx> Cc: Dave Chinner <david@xxxxxxxxxxxxx> Cc: Theodore Ts'o <tytso@xxxxxxx> Cc: Chris Mason <clm@xxxxxx> Cc: David Sterba <dsterba@xxxxxxx> Cc: Brian Foster <bfoster@xxxxxxxxxx> Cc: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Cc: Nikolay Borisov <nborisov@xxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/jbd2/journal.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN fs/jbd2/journal.c~jbd2-make-the-whole-kjournald2-kthread-nofs-safe fs/jbd2/journal.c --- a/fs/jbd2/journal.c~jbd2-make-the-whole-kjournald2-kthread-nofs-safe +++ a/fs/jbd2/journal.c @@ -43,6 +43,7 @@ #include <linux/backing-dev.h> #include <linux/bitops.h> #include <linux/ratelimit.h> +#include <linux/sched/mm.h> #define CREATE_TRACE_POINTS #include <trace/events/jbd2.h> @@ -206,6 +207,13 @@ static int kjournald2(void *arg) wake_up(&journal->j_wait_done_commit); /* + * Make sure that no allocations from this kernel thread will ever recurse + * to the fs layer because we are responsible for the transaction commit + * and any fs involvement might get stuck waiting for the trasn. commit. + */ + memalloc_nofs_save(); + + /* * And now, wait forever for commit wakeup events. */ write_lock(&journal->j_state_lock); _ Patches currently in -mm which might be from mhocko@xxxxxxxx are lockdep-allow-to-disable-reclaim-lockup-detection.patch xfs-abstract-pf_fstrans-to-pf_memalloc_nofs.patch mm-introduce-memalloc_nofs_saverestore-api.patch xfs-use-memalloc_nofs_saverestore-instead-of-memalloc_noio.patch jbd2-mark-the-transaction-context-with-the-scope-gfp_nofs-context.patch jbd2-make-the-whole-kjournald2-kthread-nofs-safe.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html