Re: [PATCH] mm, debug: mm-introduce-vm_bug_on_mm-fix-fix.patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 23, 2014 at 01:28:48PM +0200, Michal Hocko wrote:
 > And there is another one hitting during randconfig. The patch makes my
 > eyes bleed but I don't know about other way without breaking out the
 > thing into separate parts sounds worse because we can mix with other
 > messages then.

how about something along the lines of..

 bufptr = buffer = kmalloc()

 #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
	bufptr += sprintf(bufptr, "tlb_flush_pending %d\n",
			mm->tlb_flush_pending);
 #endif

 #ifdef CONFIG_MMU
	bufptr += sprintf(bufptr, "...
 #endif

 ...

 printk(KERN_EMERG "%s", buffer);

 free(buffer);


Still ugly, but looks less like a trainwreck, and keeps the variables
with the associated text.

It does introduce an allocation though, which may be problematic
in this situation. Depending how big this gets, perhaps make it static
instead?

	Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]