瀏覽代碼

[PATCH] fix BUG_ON(!PageSlab) from fallback_alloc

pdflush hit the BUG_ON(!PageSlab(page)) in kmem_freepages called from
fallback_alloc: cache_grow already freed those pages when alloc_slabmgmt
failed.  But it wouldn't have freed them if __GFP_NO_GROW, so make sure
fallback_alloc doesn't waste its time on that case.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Pekka J Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Hugh Dickins 18 年之前
父節點
當前提交
b6a6045181
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      mm/slab.c

+ 2 - 2
mm/slab.c

@@ -3281,7 +3281,7 @@ retry:
 					flags | GFP_THISNODE, nid);
 					flags | GFP_THISNODE, nid);
 	}
 	}
 
 
-	if (!obj) {
+	if (!obj && !(flags & __GFP_NO_GROW)) {
 		/*
 		/*
 		 * This allocation will be performed within the constraints
 		 * This allocation will be performed within the constraints
 		 * of the current cpuset / memory policy requirements.
 		 * of the current cpuset / memory policy requirements.
@@ -3310,7 +3310,7 @@ retry:
 					 */
 					 */
 					goto retry;
 					goto retry;
 			} else {
 			} else {
-				kmem_freepages(cache, obj);
+				/* cache_grow already freed obj */
 				obj = NULL;
 				obj = NULL;
 			}
 			}
 		}
 		}