page_mapping must avoid slub pages

This change “page_mapping must avoid slub pages” (commit b9bae34) in Linux kernel is authored by Hugh Dickins <hugh [at]> on Thu Jun 21 23:27:45 2007 +0100.

Description of "page_mapping must avoid slub pages"

The change “page_mapping must avoid slub pages” introduces changes as follows.

page_mapping must avoid slub pages

Nicolas Ferre reports oops from flush_dcache_page() on ARM when using
SLUB: which reuses page->mapping as page->slab.  The page_mapping()
function, used by ARM and PA-RISC flush_dcache_page() implementations,
must not confuse SLUB pages with those which have page->mapping set.

Signed-off-by: Hugh Dickins <>
Cc: Nicolas Ferre <>
Cc: Christoph Lameter <>
Cc: Andrew Morton <>
Signed-off-by: Linus Torvalds <>

Linux kernel releases containing commit b9bae34

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "page_mapping must avoid slub pages"

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 include/linux/mm.h | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index e4183c6c7de3..1c1207472bb4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -603,6 +603,10 @@ static inline struct address_space *page_mapping(struct page *page)
 	if (unlikely(PageSwapCache(page)))
 		mapping = &swapper_space;
+	else if (unlikely(PageSlab(page)))
+		mapping = NULL;
 	else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
 		mapping = NULL;
 	return mapping;

The commit for this change in Linux stable tree is b9bae34 (patch).

Last modified: 2020/02/11