浏览代码

[PATCH] slab: remove broken PageSlab check from kfree_debugcheck

The PageSlab debug check in kfree_debugcheck() is broken for compound
pages.  It is also redundant as we already do BUG_ON for non-slab pages in
page_get_cache() and page_get_slab() which are always called before we free
any actual objects.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Pekka Enberg 19 年之前
父节点
当前提交
6e40e73097
共有 1 个文件被更改,包括 0 次插入8 次删除
  1. 0 8
      mm/slab.c

+ 0 - 8
mm/slab.c

@@ -2814,19 +2814,11 @@ failed:
  */
  */
 static void kfree_debugcheck(const void *objp)
 static void kfree_debugcheck(const void *objp)
 {
 {
-	struct page *page;
-
 	if (!virt_addr_valid(objp)) {
 	if (!virt_addr_valid(objp)) {
 		printk(KERN_ERR "kfree_debugcheck: out of range ptr %lxh.\n",
 		printk(KERN_ERR "kfree_debugcheck: out of range ptr %lxh.\n",
 		       (unsigned long)objp);
 		       (unsigned long)objp);
 		BUG();
 		BUG();
 	}
 	}
-	page = virt_to_page(objp);
-	if (!PageSlab(page)) {
-		printk(KERN_ERR "kfree_debugcheck: bad ptr %lxh.\n",
-		       (unsigned long)objp);
-		BUG();
-	}
 }
 }
 
 
 static inline void verify_redzone_free(struct kmem_cache *cache, void *obj)
 static inline void verify_redzone_free(struct kmem_cache *cache, void *obj)