[Devel] [PATCH RHEL7 COMMIT] mm/fs: Port diff-mm-debug-memallocation-caused-fs-reentrance

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 5 02:20:02 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.9
------>
commit 255427905323ac97a3c9b2d5acb2bf21ea2b31f6
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Fri Jun 5 13:20:02 2015 +0400

    mm/fs: Port diff-mm-debug-memallocation-caused-fs-reentrance
    
    Author: Dmitry Monakhov
    Email: dmonakhov at openvz.org
    Subject: mm: debug memallocation caused fs reentrance
    Date: Sun, 9 Nov 2014 11:53:14 +0400
    
    Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
    
    =============================================================================
    
    Related to https://jira.sw.ru/browse/PSBM-33640
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 mm/page_alloc.c | 1 +
 mm/slab.c       | 2 ++
 mm/slub.c       | 1 +
 3 files changed, 4 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 627677c..8fbe108 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2690,6 +2690,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
 	lockdep_trace_alloc(gfp_mask);
 
 	might_sleep_if(gfp_mask & __GFP_WAIT);
+	WARN_ON((gfp_mask & __GFP_FS) && current->journal_info);
 
 	if (should_fail_alloc_page(gfp_mask, order))
 		return NULL;
diff --git a/mm/slab.c b/mm/slab.c
index d647f42..3c82384 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3343,6 +3343,7 @@ slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid,
 	flags &= gfp_allowed_mask;
 
 	lockdep_trace_alloc(flags);
+	WARN_ON((flags & __GFP_FS) && current->journal_info);
 
 	if (slab_should_failslab(cachep, flags))
 		return NULL;
@@ -3431,6 +3432,7 @@ slab_alloc(struct kmem_cache *cachep, gfp_t flags, unsigned long caller)
 	flags &= gfp_allowed_mask;
 
 	lockdep_trace_alloc(flags);
+	WARN_ON((flags & __GFP_FS) && current->journal_info);
 
 	if (slab_should_failslab(cachep, flags))
 		return NULL;
diff --git a/mm/slub.c b/mm/slub.c
index 6d5957a..347650c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -936,6 +936,7 @@ static inline int slab_pre_alloc_hook(struct kmem_cache *s, gfp_t flags)
 	flags &= gfp_allowed_mask;
 	lockdep_trace_alloc(flags);
 	might_sleep_if(flags & __GFP_WAIT);
+	WARN_ON((flags & __GFP_FS) && current->journal_info);
 
 	return should_failslab(s->object_size, flags, s->flags);
 }



More information about the Devel mailing list