All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20140311083009.GA32004@lge.com>

diff --git a/a/1.txt b/N1/1.txt
index 3a6f52d..1ebd51b 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -41,3 +41,216 @@ Here is the fix for this problem.
 Thanks for reporting it.
 
 ---------8<---------------------
+>From ff6fe77fb764ca5bf8705bf53d07d38e4111e84c Mon Sep 17 00:00:00 2001
+From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
+Date: Tue, 11 Mar 2014 14:14:25 +0900
+Subject: [PATCH] slab: remove kernel_map_pages() optimization in slab
+ poisoning
+
+If CONFIG_DEBUG_PAGEALLOC enables, slab poisoning functionality uses
+kernel_map_pages(), instead of real poisoning, to detect memory corruption
+with low overhead. But, in that case, slab leak detector trigger oops.
+Reason is that slab leak detector accesses all active objects, especially
+including objects in cpu slab caches to get the caller information.
+These objects are already unmapped via kernel_map_pages() to detect memory
+corruption, so oops could be triggered.
+
+Following is oops message reported from Dave.
+
+It blew up when something tried to read /proc/slab_allocators
+(Just cat it, and you should see the oops below)
+
+  Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
+  Modules linked in: fuse hidp snd_seq_dummy tun rfcomm bnep llc2 af_key can_raw ipt_ULOG can_bcm nfnetlink scsi_transport_iscsi nfc caif_socket caif af_802154 phonet af_rxrpc can pppoe pppox ppp_generic
+  +slhc irda crc_ccitt rds rose x25 atm netrom appletalk ipx p8023 psnap p8022 llc ax25 cfg80211 xfs coretemp hwmon x86_pkg_temp_thermal kvm_intel kvm crct10dif_pclmul crc32c_intel ghash_clmulni_intel
+  +libcrc32c usb_debug microcode snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic pcspkr btusb bluetooth 6lowpan_iphc rfkill snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm
+  +snd_timer e1000e snd ptp shpchp soundcore pps_core serio_raw
+  CPU: 1 PID: 9386 Comm: trinity-c33 Not tainted 3.14.0-rc5+ #131
+  task: ffff8801aa46e890 ti: ffff880076924000 task.ti: ffff880076924000
+  RIP: 0010:[<ffffffffaa1a8f4a>]  [<ffffffffaa1a8f4a>] handle_slab+0x8a/0x180
+  RSP: 0018:ffff880076925de0  EFLAGS: 00010002
+  RAX: 0000000000001000 RBX: 0000000000000000 RCX: 000000005ce85ce7
+  RDX: ffffea00079be100 RSI: 0000000000001000 RDI: ffff880107458000
+  RBP: ffff880076925e18 R08: 0000000000000001 R09: 0000000000000000
+  R10: 0000000000000000 R11: 000000000000000f R12: ffff8801e6f84000
+  R13: ffffea00079be100 R14: ffff880107458000 R15: ffff88022bb8d2c0
+  FS:  00007fb769e45740(0000) GS:ffff88024d040000(0000) knlGS:0000000000000000
+  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+  CR2: ffff8801e6f84ff8 CR3: 00000000a22db000 CR4: 00000000001407e0
+  DR0: 0000000002695000 DR1: 0000000002695000 DR2: 0000000000000000
+  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000070602
+  Stack:
+   ffff8802339dcfc0 ffff88022bb8d2c0 ffff880107458000 ffff88022bb8d2c0
+   ffff8802339dd008 ffff8802339dcfc0 ffffea00079be100 ffff880076925e68
+   ffffffffaa1ad9be ffff880203fe4f00 ffff88022bb8d318 0000000076925e98
+  Call Trace:
+   [<ffffffffaa1ad9be>] leaks_show+0xce/0x240
+   [<ffffffffaa1e6c0e>] seq_read+0x28e/0x490
+   [<ffffffffaa23008d>] proc_reg_read+0x3d/0x80
+   [<ffffffffaa1c026b>] vfs_read+0x9b/0x160
+   [<ffffffffaa1c0d88>] SyS_read+0x58/0xb0
+   [<ffffffffaa7420aa>] tracesys+0xd4/0xd9
+  Code: f5 00 00 00 0f 1f 44 00 00 48 63 c8 44 3b 0c 8a 0f 84 e3 00 00 00 83 c0 01 44 39 c0 72 eb 41 f6 47 1a 01 0f 84 e9 00 00 00 89 f0 <4d> 8b 4c 04 f8 4d 85 c9 0f 84 88 00 00 00 49 8b 7e 08 4d 8d 46
+  RIP  [<ffffffffaa1a8f4a>] handle_slab+0x8a/0x180
+   RSP <ffff880076925de0>
+  CR2: ffff8801e6f84ff8
+
+There are two solutions to fix the problem. One is to disable
+CONFIG_DEBUG_SLAB_LEAK if CONFIG_DEBUG_PAGEALLOC=y. The other is to remove
+kernel_map_pages() optimization in slab poisoning. I think that
+second one is better, since we can use all functionality with some more
+overhead. slab poisoning is already heavy operation, so adding more
+overhead doesn't weaken their value.
+
+Reported-by: Dave Jones <davej@redhat.com>
+Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
+
+diff --git a/mm/slab.c b/mm/slab.c
+index b264214..a35aeea 100644
+--- a/mm/slab.c
++++ b/mm/slab.c
+@@ -1739,41 +1739,6 @@ static void kmem_rcu_free(struct rcu_head *head)
+ }
+ 
+ #if DEBUG
+-
+-#ifdef CONFIG_DEBUG_PAGEALLOC
+-static void store_stackinfo(struct kmem_cache *cachep, unsigned long *addr,
+-			    unsigned long caller)
+-{
+-	int size = cachep->object_size;
+-
+-	addr = (unsigned long *)&((char *)addr)[obj_offset(cachep)];
+-
+-	if (size < 5 * sizeof(unsigned long))
+-		return;
+-
+-	*addr++ = 0x12345678;
+-	*addr++ = caller;
+-	*addr++ = smp_processor_id();
+-	size -= 3 * sizeof(unsigned long);
+-	{
+-		unsigned long *sptr = &caller;
+-		unsigned long svalue;
+-
+-		while (!kstack_end(sptr)) {
+-			svalue = *sptr++;
+-			if (kernel_text_address(svalue)) {
+-				*addr++ = svalue;
+-				size -= sizeof(unsigned long);
+-				if (size <= sizeof(unsigned long))
+-					break;
+-			}
+-		}
+-
+-	}
+-	*addr++ = 0x87654321;
+-}
+-#endif
+-
+ static void poison_obj(struct kmem_cache *cachep, void *addr, unsigned char val)
+ {
+ 	int size = cachep->object_size;
+@@ -1914,18 +1879,9 @@ static void slab_destroy_debugcheck(struct kmem_cache *cachep,
+ 	for (i = 0; i < cachep->num; i++) {
+ 		void *objp = index_to_obj(cachep, page, i);
+ 
+-		if (cachep->flags & SLAB_POISON) {
+-#ifdef CONFIG_DEBUG_PAGEALLOC
+-			if (cachep->size % PAGE_SIZE == 0 &&
+-					OFF_SLAB(cachep))
+-				kernel_map_pages(virt_to_page(objp),
+-					cachep->size / PAGE_SIZE, 1);
+-			else
+-				check_poison_obj(cachep, objp);
+-#else
++		if (cachep->flags & SLAB_POISON)
+ 			check_poison_obj(cachep, objp);
+-#endif
+-		}
++
+ 		if (cachep->flags & SLAB_RED_ZONE) {
+ 			if (*dbg_redzone1(cachep, objp) != RED_INACTIVE)
+ 				slab_error(cachep, "start of a freed object "
+@@ -2227,14 +2183,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
+ 		else
+ 			size += BYTES_PER_WORD;
+ 	}
+-#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
+-	if (size >= kmalloc_size(INDEX_NODE + 1)
+-	    && cachep->object_size > cache_line_size()
+-	    && ALIGN(size, cachep->align) < PAGE_SIZE) {
+-		cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);
+-		size = PAGE_SIZE;
+-	}
+-#endif
+ #endif
+ 
+ 	/*
+@@ -2273,15 +2221,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
+ 	if (flags & CFLGS_OFF_SLAB) {
+ 		/* really off slab. No need for manual alignment */
+ 		freelist_size = cachep->num * sizeof(unsigned int);
+-
+-#ifdef CONFIG_PAGE_POISONING
+-		/* If we're going to use the generic kernel_map_pages()
+-		 * poisoning, then it's going to smash the contents of
+-		 * the redzone and userword anyhow, so switch them off.
+-		 */
+-		if (size % PAGE_SIZE == 0 && flags & SLAB_POISON)
+-			flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
+-#endif
+ 	}
+ 
+ 	cachep->colour_off = cache_line_size();
+@@ -2581,10 +2520,6 @@ static void cache_init_objs(struct kmem_cache *cachep,
+ 				slab_error(cachep, "constructor overwrote the"
+ 					   " start of an object");
+ 		}
+-		if ((cachep->size % PAGE_SIZE) == 0 &&
+-			    OFF_SLAB(cachep) && cachep->flags & SLAB_POISON)
+-			kernel_map_pages(virt_to_page(objp),
+-					 cachep->size / PAGE_SIZE, 0);
+ #else
+ 		if (cachep->ctor)
+ 			cachep->ctor(objp);
+@@ -2797,19 +2732,9 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp,
+ 	BUG_ON(objnr >= cachep->num);
+ 	BUG_ON(objp != index_to_obj(cachep, page, objnr));
+ 
+-	if (cachep->flags & SLAB_POISON) {
+-#ifdef CONFIG_DEBUG_PAGEALLOC
+-		if ((cachep->size % PAGE_SIZE)==0 && OFF_SLAB(cachep)) {
+-			store_stackinfo(cachep, objp, caller);
+-			kernel_map_pages(virt_to_page(objp),
+-					 cachep->size / PAGE_SIZE, 0);
+-		} else {
+-			poison_obj(cachep, objp, POISON_FREE);
+-		}
+-#else
++	if (cachep->flags & SLAB_POISON)
+ 		poison_obj(cachep, objp, POISON_FREE);
+-#endif
+-	}
++
+ 	return objp;
+ }
+ 
+@@ -2933,15 +2858,7 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,
+ 	if (!objp)
+ 		return objp;
+ 	if (cachep->flags & SLAB_POISON) {
+-#ifdef CONFIG_DEBUG_PAGEALLOC
+-		if ((cachep->size % PAGE_SIZE) == 0 && OFF_SLAB(cachep))
+-			kernel_map_pages(virt_to_page(objp),
+-					 cachep->size / PAGE_SIZE, 1);
+-		else
+-			check_poison_obj(cachep, objp);
+-#else
+ 		check_poison_obj(cachep, objp);
+-#endif
+ 		poison_obj(cachep, objp, POISON_INUSE);
+ 	}
+ 	if (cachep->flags & SLAB_STORE_USER)
+-- 
+1.7.9.5
diff --git a/a/content_digest b/N1/content_digest
index 2cc9773..5446d4a 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -58,6 +58,219 @@
  "Here is the fix for this problem.\n"
  "Thanks for reporting it.\n"
  "\n"
- ---------8<---------------------
+ "---------8<---------------------\n"
+ ">From ff6fe77fb764ca5bf8705bf53d07d38e4111e84c Mon Sep 17 00:00:00 2001\n"
+ "From: Joonsoo Kim <iamjoonsoo.kim@lge.com>\n"
+ "Date: Tue, 11 Mar 2014 14:14:25 +0900\n"
+ "Subject: [PATCH] slab: remove kernel_map_pages() optimization in slab\n"
+ " poisoning\n"
+ "\n"
+ "If CONFIG_DEBUG_PAGEALLOC enables, slab poisoning functionality uses\n"
+ "kernel_map_pages(), instead of real poisoning, to detect memory corruption\n"
+ "with low overhead. But, in that case, slab leak detector trigger oops.\n"
+ "Reason is that slab leak detector accesses all active objects, especially\n"
+ "including objects in cpu slab caches to get the caller information.\n"
+ "These objects are already unmapped via kernel_map_pages() to detect memory\n"
+ "corruption, so oops could be triggered.\n"
+ "\n"
+ "Following is oops message reported from Dave.\n"
+ "\n"
+ "It blew up when something tried to read /proc/slab_allocators\n"
+ "(Just cat it, and you should see the oops below)\n"
+ "\n"
+ "  Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC\n"
+ "  Modules linked in: fuse hidp snd_seq_dummy tun rfcomm bnep llc2 af_key can_raw ipt_ULOG can_bcm nfnetlink scsi_transport_iscsi nfc caif_socket caif af_802154 phonet af_rxrpc can pppoe pppox ppp_generic\n"
+ "  +slhc irda crc_ccitt rds rose x25 atm netrom appletalk ipx p8023 psnap p8022 llc ax25 cfg80211 xfs coretemp hwmon x86_pkg_temp_thermal kvm_intel kvm crct10dif_pclmul crc32c_intel ghash_clmulni_intel\n"
+ "  +libcrc32c usb_debug microcode snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic pcspkr btusb bluetooth 6lowpan_iphc rfkill snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm\n"
+ "  +snd_timer e1000e snd ptp shpchp soundcore pps_core serio_raw\n"
+ "  CPU: 1 PID: 9386 Comm: trinity-c33 Not tainted 3.14.0-rc5+ #131\n"
+ "  task: ffff8801aa46e890 ti: ffff880076924000 task.ti: ffff880076924000\n"
+ "  RIP: 0010:[<ffffffffaa1a8f4a>]  [<ffffffffaa1a8f4a>] handle_slab+0x8a/0x180\n"
+ "  RSP: 0018:ffff880076925de0  EFLAGS: 00010002\n"
+ "  RAX: 0000000000001000 RBX: 0000000000000000 RCX: 000000005ce85ce7\n"
+ "  RDX: ffffea00079be100 RSI: 0000000000001000 RDI: ffff880107458000\n"
+ "  RBP: ffff880076925e18 R08: 0000000000000001 R09: 0000000000000000\n"
+ "  R10: 0000000000000000 R11: 000000000000000f R12: ffff8801e6f84000\n"
+ "  R13: ffffea00079be100 R14: ffff880107458000 R15: ffff88022bb8d2c0\n"
+ "  FS:  00007fb769e45740(0000) GS:ffff88024d040000(0000) knlGS:0000000000000000\n"
+ "  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n"
+ "  CR2: ffff8801e6f84ff8 CR3: 00000000a22db000 CR4: 00000000001407e0\n"
+ "  DR0: 0000000002695000 DR1: 0000000002695000 DR2: 0000000000000000\n"
+ "  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000070602\n"
+ "  Stack:\n"
+ "   ffff8802339dcfc0 ffff88022bb8d2c0 ffff880107458000 ffff88022bb8d2c0\n"
+ "   ffff8802339dd008 ffff8802339dcfc0 ffffea00079be100 ffff880076925e68\n"
+ "   ffffffffaa1ad9be ffff880203fe4f00 ffff88022bb8d318 0000000076925e98\n"
+ "  Call Trace:\n"
+ "   [<ffffffffaa1ad9be>] leaks_show+0xce/0x240\n"
+ "   [<ffffffffaa1e6c0e>] seq_read+0x28e/0x490\n"
+ "   [<ffffffffaa23008d>] proc_reg_read+0x3d/0x80\n"
+ "   [<ffffffffaa1c026b>] vfs_read+0x9b/0x160\n"
+ "   [<ffffffffaa1c0d88>] SyS_read+0x58/0xb0\n"
+ "   [<ffffffffaa7420aa>] tracesys+0xd4/0xd9\n"
+ "  Code: f5 00 00 00 0f 1f 44 00 00 48 63 c8 44 3b 0c 8a 0f 84 e3 00 00 00 83 c0 01 44 39 c0 72 eb 41 f6 47 1a 01 0f 84 e9 00 00 00 89 f0 <4d> 8b 4c 04 f8 4d 85 c9 0f 84 88 00 00 00 49 8b 7e 08 4d 8d 46\n"
+ "  RIP  [<ffffffffaa1a8f4a>] handle_slab+0x8a/0x180\n"
+ "   RSP <ffff880076925de0>\n"
+ "  CR2: ffff8801e6f84ff8\n"
+ "\n"
+ "There are two solutions to fix the problem. One is to disable\n"
+ "CONFIG_DEBUG_SLAB_LEAK if CONFIG_DEBUG_PAGEALLOC=y. The other is to remove\n"
+ "kernel_map_pages() optimization in slab poisoning. I think that\n"
+ "second one is better, since we can use all functionality with some more\n"
+ "overhead. slab poisoning is already heavy operation, so adding more\n"
+ "overhead doesn't weaken their value.\n"
+ "\n"
+ "Reported-by: Dave Jones <davej@redhat.com>\n"
+ "Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>\n"
+ "\n"
+ "diff --git a/mm/slab.c b/mm/slab.c\n"
+ "index b264214..a35aeea 100644\n"
+ "--- a/mm/slab.c\n"
+ "+++ b/mm/slab.c\n"
+ "@@ -1739,41 +1739,6 @@ static void kmem_rcu_free(struct rcu_head *head)\n"
+ " }\n"
+ " \n"
+ " #if DEBUG\n"
+ "-\n"
+ "-#ifdef CONFIG_DEBUG_PAGEALLOC\n"
+ "-static void store_stackinfo(struct kmem_cache *cachep, unsigned long *addr,\n"
+ "-\t\t\t    unsigned long caller)\n"
+ "-{\n"
+ "-\tint size = cachep->object_size;\n"
+ "-\n"
+ "-\taddr = (unsigned long *)&((char *)addr)[obj_offset(cachep)];\n"
+ "-\n"
+ "-\tif (size < 5 * sizeof(unsigned long))\n"
+ "-\t\treturn;\n"
+ "-\n"
+ "-\t*addr++ = 0x12345678;\n"
+ "-\t*addr++ = caller;\n"
+ "-\t*addr++ = smp_processor_id();\n"
+ "-\tsize -= 3 * sizeof(unsigned long);\n"
+ "-\t{\n"
+ "-\t\tunsigned long *sptr = &caller;\n"
+ "-\t\tunsigned long svalue;\n"
+ "-\n"
+ "-\t\twhile (!kstack_end(sptr)) {\n"
+ "-\t\t\tsvalue = *sptr++;\n"
+ "-\t\t\tif (kernel_text_address(svalue)) {\n"
+ "-\t\t\t\t*addr++ = svalue;\n"
+ "-\t\t\t\tsize -= sizeof(unsigned long);\n"
+ "-\t\t\t\tif (size <= sizeof(unsigned long))\n"
+ "-\t\t\t\t\tbreak;\n"
+ "-\t\t\t}\n"
+ "-\t\t}\n"
+ "-\n"
+ "-\t}\n"
+ "-\t*addr++ = 0x87654321;\n"
+ "-}\n"
+ "-#endif\n"
+ "-\n"
+ " static void poison_obj(struct kmem_cache *cachep, void *addr, unsigned char val)\n"
+ " {\n"
+ " \tint size = cachep->object_size;\n"
+ "@@ -1914,18 +1879,9 @@ static void slab_destroy_debugcheck(struct kmem_cache *cachep,\n"
+ " \tfor (i = 0; i < cachep->num; i++) {\n"
+ " \t\tvoid *objp = index_to_obj(cachep, page, i);\n"
+ " \n"
+ "-\t\tif (cachep->flags & SLAB_POISON) {\n"
+ "-#ifdef CONFIG_DEBUG_PAGEALLOC\n"
+ "-\t\t\tif (cachep->size % PAGE_SIZE == 0 &&\n"
+ "-\t\t\t\t\tOFF_SLAB(cachep))\n"
+ "-\t\t\t\tkernel_map_pages(virt_to_page(objp),\n"
+ "-\t\t\t\t\tcachep->size / PAGE_SIZE, 1);\n"
+ "-\t\t\telse\n"
+ "-\t\t\t\tcheck_poison_obj(cachep, objp);\n"
+ "-#else\n"
+ "+\t\tif (cachep->flags & SLAB_POISON)\n"
+ " \t\t\tcheck_poison_obj(cachep, objp);\n"
+ "-#endif\n"
+ "-\t\t}\n"
+ "+\n"
+ " \t\tif (cachep->flags & SLAB_RED_ZONE) {\n"
+ " \t\t\tif (*dbg_redzone1(cachep, objp) != RED_INACTIVE)\n"
+ " \t\t\t\tslab_error(cachep, \"start of a freed object \"\n"
+ "@@ -2227,14 +2183,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)\n"
+ " \t\telse\n"
+ " \t\t\tsize += BYTES_PER_WORD;\n"
+ " \t}\n"
+ "-#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)\n"
+ "-\tif (size >= kmalloc_size(INDEX_NODE + 1)\n"
+ "-\t    && cachep->object_size > cache_line_size()\n"
+ "-\t    && ALIGN(size, cachep->align) < PAGE_SIZE) {\n"
+ "-\t\tcachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);\n"
+ "-\t\tsize = PAGE_SIZE;\n"
+ "-\t}\n"
+ "-#endif\n"
+ " #endif\n"
+ " \n"
+ " \t/*\n"
+ "@@ -2273,15 +2221,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)\n"
+ " \tif (flags & CFLGS_OFF_SLAB) {\n"
+ " \t\t/* really off slab. No need for manual alignment */\n"
+ " \t\tfreelist_size = cachep->num * sizeof(unsigned int);\n"
+ "-\n"
+ "-#ifdef CONFIG_PAGE_POISONING\n"
+ "-\t\t/* If we're going to use the generic kernel_map_pages()\n"
+ "-\t\t * poisoning, then it's going to smash the contents of\n"
+ "-\t\t * the redzone and userword anyhow, so switch them off.\n"
+ "-\t\t */\n"
+ "-\t\tif (size % PAGE_SIZE == 0 && flags & SLAB_POISON)\n"
+ "-\t\t\tflags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);\n"
+ "-#endif\n"
+ " \t}\n"
+ " \n"
+ " \tcachep->colour_off = cache_line_size();\n"
+ "@@ -2581,10 +2520,6 @@ static void cache_init_objs(struct kmem_cache *cachep,\n"
+ " \t\t\t\tslab_error(cachep, \"constructor overwrote the\"\n"
+ " \t\t\t\t\t   \" start of an object\");\n"
+ " \t\t}\n"
+ "-\t\tif ((cachep->size % PAGE_SIZE) == 0 &&\n"
+ "-\t\t\t    OFF_SLAB(cachep) && cachep->flags & SLAB_POISON)\n"
+ "-\t\t\tkernel_map_pages(virt_to_page(objp),\n"
+ "-\t\t\t\t\t cachep->size / PAGE_SIZE, 0);\n"
+ " #else\n"
+ " \t\tif (cachep->ctor)\n"
+ " \t\t\tcachep->ctor(objp);\n"
+ "@@ -2797,19 +2732,9 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp,\n"
+ " \tBUG_ON(objnr >= cachep->num);\n"
+ " \tBUG_ON(objp != index_to_obj(cachep, page, objnr));\n"
+ " \n"
+ "-\tif (cachep->flags & SLAB_POISON) {\n"
+ "-#ifdef CONFIG_DEBUG_PAGEALLOC\n"
+ "-\t\tif ((cachep->size % PAGE_SIZE)==0 && OFF_SLAB(cachep)) {\n"
+ "-\t\t\tstore_stackinfo(cachep, objp, caller);\n"
+ "-\t\t\tkernel_map_pages(virt_to_page(objp),\n"
+ "-\t\t\t\t\t cachep->size / PAGE_SIZE, 0);\n"
+ "-\t\t} else {\n"
+ "-\t\t\tpoison_obj(cachep, objp, POISON_FREE);\n"
+ "-\t\t}\n"
+ "-#else\n"
+ "+\tif (cachep->flags & SLAB_POISON)\n"
+ " \t\tpoison_obj(cachep, objp, POISON_FREE);\n"
+ "-#endif\n"
+ "-\t}\n"
+ "+\n"
+ " \treturn objp;\n"
+ " }\n"
+ " \n"
+ "@@ -2933,15 +2858,7 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,\n"
+ " \tif (!objp)\n"
+ " \t\treturn objp;\n"
+ " \tif (cachep->flags & SLAB_POISON) {\n"
+ "-#ifdef CONFIG_DEBUG_PAGEALLOC\n"
+ "-\t\tif ((cachep->size % PAGE_SIZE) == 0 && OFF_SLAB(cachep))\n"
+ "-\t\t\tkernel_map_pages(virt_to_page(objp),\n"
+ "-\t\t\t\t\t cachep->size / PAGE_SIZE, 1);\n"
+ "-\t\telse\n"
+ "-\t\t\tcheck_poison_obj(cachep, objp);\n"
+ "-#else\n"
+ " \t\tcheck_poison_obj(cachep, objp);\n"
+ "-#endif\n"
+ " \t\tpoison_obj(cachep, objp, POISON_INUSE);\n"
+ " \t}\n"
+ " \tif (cachep->flags & SLAB_STORE_USER)\n"
+ "-- \n"
+ 1.7.9.5
 
-600ce5ecfaeebad58caefebb28357ab95fceebb235fc2fa332a4d9aedbb475df
+18dd105eee8165ac7854691a63c0cb2917ff5d6e81998b7f85d5d15125cd643e

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.