Re: [REGRESSION] RLIMIT_DATA crashes named

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

 



On Sun, 2016-09-18 at 00:40 +0300, Konstantin Khlebnikov wrote:
> #define printk_periodic(period, fmt, ...)
> ({
>         static unsigned long __prev __read_mostly = INITIAL_JIFFIES - (period);
>         unsigned long __now = jiffies;
>         bool __print = !time_in_range_open(__now, __prev, __prev + (period));
> 
>         if (__print) {
>                 __prev = __now;
>                 printk(fmt, ##__VA_ARGS__);
>         }
>         unlikely(__print);
> })

printk_periodic reads like a thing that would create a
thread to printk a message every period.

And trivially, period should be copied to a temporary
and not be reused (use your choice of # of underscores)

	unsigned long _period = period;
	unsigned long _now = now;
	static unsigned long _prev __read_mostly = etc...

--
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]