Re: [patch] oom: dump stack and VM state when oom killer panics

From: Joe Perches
Date: Mon Sep 21 2009 - 17:12:26 EST


On Mon, 2009-09-21 at 13:41 -0700, Andrew Morton wrote:
> The code shouldn't be using printk_ratelimit() - in fact nothing should
> be using it and we should remove printk_ratelimit() from the kernel, I
> suspect.

Perhaps a per instance use instead. Something like:

#define printk_ratelimited(fmt, arg...) \
({ static struct ratelimit_state _rs = { \
.interval = DEFAULT_RATELIMIT_INTERVAL, \
.burst = DEFAULT_RATELIMIT_BURST, \
}; \
int rtn; \
\
if (!__ratelimit(&_rs)) \
rtn = printk(fmt, ##arg); \
else \
rtn = 0; \
rtn; \
})

#define pr_info_rl(fmt, arg) \
printk_ratelimited(KERN_INFO pr_fmt(fmt), ##arg)
etc...


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/