From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:36008 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753780AbdBFOHh (ORCPT ); Mon, 6 Feb 2017 09:07:37 -0500 From: Michal Hocko To: Andrew Morton , Cc: , Dave Chinner , djwong@kernel.org, "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: [PATCH 6/6] jbd2: make the whole kjournald2 kthread NOFS safe Date: Mon, 6 Feb 2017 15:07:18 +0100 Message-Id: <20170206140718.16222-7-mhocko@kernel.org> In-Reply-To: <20170206140718.16222-1-mhocko@kernel.org> References: <20170206140718.16222-1-mhocko@kernel.org> Sender: linux-btrfs-owner@vger.kernel.org List-ID: 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 Reviewed-by: Jan Kara Signed-off-by: Michal Hocko --- fs/jbd2/journal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 704139625fbe..662531a70ce1 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.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Michal Hocko To: Andrew Morton , Cc: , Dave Chinner , djwong@kernel.org, "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: [PATCH 6/6] jbd2: make the whole kjournald2 kthread NOFS safe Date: Mon, 6 Feb 2017 15:07:18 +0100 Message-Id: <20170206140718.16222-7-mhocko@kernel.org> In-Reply-To: <20170206140718.16222-1-mhocko@kernel.org> References: <20170206140718.16222-1-mhocko@kernel.org> Sender: owner-linux-mm@kvack.org List-ID: 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 Reviewed-by: Jan Kara Signed-off-by: Michal Hocko --- fs/jbd2/journal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 704139625fbe..662531a70ce1 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.11.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:36008 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753780AbdBFOHh (ORCPT ); Mon, 6 Feb 2017 09:07:37 -0500 From: Michal Hocko Subject: [PATCH 6/6] jbd2: make the whole kjournald2 kthread NOFS safe Date: Mon, 6 Feb 2017 15:07:18 +0100 Message-Id: <20170206140718.16222-7-mhocko@kernel.org> In-Reply-To: <20170206140718.16222-1-mhocko@kernel.org> References: <20170206140718.16222-1-mhocko@kernel.org> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Andrew Morton , linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org, Dave Chinner , djwong@kernel.org, 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 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 Reviewed-by: Jan Kara Signed-off-by: Michal Hocko --- fs/jbd2/journal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 704139625fbe..662531a70ce1 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.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: [PATCH 6/6] jbd2: make the whole kjournald2 kthread NOFS safe Date: Mon, 6 Feb 2017 15:07:18 +0100 Message-ID: <20170206140718.16222-7-mhocko@kernel.org> References: <20170206140718.16222-1-mhocko@kernel.org> Return-path: In-Reply-To: <20170206140718.16222-1-mhocko@kernel.org> Sender: owner-linux-mm@kvack.org To: Andrew Morton , linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org, Dave Chinner , djwong@kernel.org, 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 List-Id: ceph-devel.vger.kernel.org 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 Reviewed-by: Jan Kara Signed-off-by: Michal Hocko --- fs/jbd2/journal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 704139625fbe..662531a70ce1 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.11.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Date: Mon, 6 Feb 2017 15:07:18 +0100 Subject: [Cluster-devel] [PATCH 6/6] jbd2: make the whole kjournald2 kthread NOFS safe In-Reply-To: <20170206140718.16222-1-mhocko@kernel.org> References: <20170206140718.16222-1-mhocko@kernel.org> Message-ID: <20170206140718.16222-7-mhocko@kernel.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 Reviewed-by: Jan Kara Signed-off-by: Michal Hocko --- fs/jbd2/journal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 704139625fbe..662531a70ce1 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.11.0