From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932536AbcIQVwo (ORCPT ); Sat, 17 Sep 2016 17:52:44 -0400 Received: from smtprelay0187.hostedemail.com ([216.40.44.187]:36234 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932179AbcIQVwf (ORCPT ); Sat, 17 Sep 2016 17:52:35 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2914:3138:3139:3140:3141:3142:3352:3622:3866:3867:3868:3874:4321:4605:5007:10004:10400:10848:11026:11658:11914:12296:12740:13069:13095:13311:13357:13439:13894:14659:14721:21080:21433:21451:30054:30060:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: pot94_16295add7064c X-Filterd-Recvd-Size: 2631 Message-ID: <1474149151.1954.4.camel@perches.com> Subject: Re: [REGRESSION] RLIMIT_DATA crashes named From: Joe Perches To: Konstantin Khlebnikov , Cyrill Gorcunov Cc: Linus Torvalds , Sam Varshavchik , Ingo Molnar , Laura Abbott , Brent , Andrew Morton , Christian Borntraeger , "linux-mm@kvack.org" , Linux Kernel Mailing List Date: Sat, 17 Sep 2016 14:52:31 -0700 In-Reply-To: References: <1474085296.32273.95.camel@perches.com> <20160917090941.GB26044@uranus.lan> <20160917122021.GC26044@uranus.lan> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.21.91-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...