mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6.35-rc6 patch] increase kmemleak robustness at boot
@ 2010-07-28 16:40 Daniel J Blueman
  2010-07-28 16:49 ` Pekka Enberg
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel J Blueman @ 2010-07-28 16:40 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Pekka Enberg, Linux Kernel

Hi Catalin,

I've consistently been experiencing kmemleak exhaust it's 400-entry
early-boot buffer and disabling itself; there have been reports of
this also, and I'm finding this on x86-64 with various debug options
enabled.

If we issue a warning and allow the buffer to wrap, we don't need to
hit the kill-switch. While we lose track of some early potential
leaks, it's better than no functionality.

Let me know if it's acceptable, and many thanks for such an excellent tool,
  Daniel

---

Allow the early-boot buffer to wrap, rather than disabling kmemleak
and losing the functionality.

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 2c0d032..93bf8a3 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -786,13 +786,6 @@ static void __init log_early(int op_type, const
void *ptr, size_t size,
 	unsigned long flags;
 	struct early_log *log;

-	if (crt_early_log >= ARRAY_SIZE(early_log)) {
-		pr_warning("Early log buffer exceeded, "
-			   "please increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE\n");
-		kmemleak_disable();
-		return;
-	}
-
 	/*
 	 * There is no need for locking since the kernel is still in UP mode
 	 * at this stage. Disabling the IRQs is enough.
@@ -805,7 +798,13 @@ static void __init log_early(int op_type, const
void *ptr, size_t size,
 	log->min_count = min_count;
 	if (op_type == KMEMLEAK_ALLOC)
 		log->trace_len = __save_stack_trace(log->trace);
+
 	crt_early_log++;
+	if (crt_early_log >= ARRAY_SIZE(early_log)) {
+		pr_warning("Early log buffer exhausted - wrapping\n");
+		crt_early_log = 0;
+	}
+	
 	local_irq_restore(flags);
 }

-- 
Daniel J Blueman

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-07-31  9:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28 16:40 [2.6.35-rc6 patch] increase kmemleak robustness at boot Daniel J Blueman
2010-07-28 16:49 ` Pekka Enberg
2010-07-28 18:39   ` Daniel J Blueman
2010-07-29 11:34   ` Catalin Marinas
2010-07-29 12:48     ` Daniel J Blueman
2010-07-29 15:12       ` Pekka Enberg
2010-07-29 18:03         ` Daniel J Blueman
2010-07-29 18:50           ` Pekka Enberg
2010-07-29 20:39             ` Catalin Marinas
2010-07-31  9:42               ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome