[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1474149151.1954.4.camel@perches.com>
Date: Sat, 17 Sep 2016 14:52:31 -0700
From: Joe Perches <joe@...ches.com>
To: Konstantin Khlebnikov <koct9i@...il.com>,
Cyrill Gorcunov <gorcunov@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Sam Varshavchik <mrsam@...rier-mta.com>,
Ingo Molnar <mingo@...nel.org>,
Laura Abbott <labbott@...hat.com>, Brent <fix@...realm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Christian Borntraeger <borntraeger@...ibm.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [REGRESSION] RLIMIT_DATA crashes named
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...
Powered by blists - more mailing lists