Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755604AbcLSJhG (ORCPT ); Mon, 19 Dec 2016 04:37:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:45082 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755063AbcLSJg5 (ORCPT ); Mon, 19 Dec 2016 04:36:57 -0500 Date: Fri, 16 Dec 2016 09:40:57 +0100 From: Jan Kara To: Michal Hocko Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Dave Chinner , "Theodore Ts'o" , Chris Mason , David Sterba , Jan Kara , ceph-devel@vger.kernel.org, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, logfs@logfs.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mtd@lists.infradead.org, reiserfs-devel@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, linux-f2fs-devel@lists.sourceforge.net, linux-afs@lists.infradead.org, LKML , Michal Hocko Subject: Re: [PATCH 7/9] jbd2: make the whole kjournald2 kthread NOFS safe Message-ID: <20161216084057.GE26608@quack2.suse.cz> References: <20161215140715.12732-1-mhocko@kernel.org> <20161215140715.12732-8-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161215140715.12732-8-mhocko@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1262 Lines: 44 On Thu 15-12-16 15:07:13, Michal Hocko wrote: > From: Michal Hocko > > 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. > > Suggested-by: Jan Kara > Signed-off-by: Michal Hocko Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/jbd2/journal.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c > index 8ed971eeab44..6dad8c5d6ddf 100644 > --- a/fs/jbd2/journal.c > +++ b/fs/jbd2/journal.c > @@ -206,6 +206,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); > -- > 2.10.2 > -- Jan Kara SUSE Labs, CR