From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751716AbcF2KYv (ORCPT ); Wed, 29 Jun 2016 06:24:51 -0400 Received: from smtprelay0008.hostedemail.com ([216.40.44.8]:44081 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751141AbcF2KYu (ORCPT ); Wed, 29 Jun 2016 06:24:50 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:173:355:379:541:599:800:960:973: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:3138:3139:3140:3141:3142:3167:3352:3622:3865:3866:3867:3868:3870:3871:3872:4321:5007:7576:7903:8603:10004:10400:10848:11232:11658:11914:12048:12296:12517:12519:12740:13069:13161:13229:13311:13357:13439:13869:13894:14181:14659:14721:21080:21212,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:2,LUA_SUMMARY:none X-HE-Tag: dogs23_80e89c3be4553 X-Filterd-Recvd-Size: 1961 Message-ID: <1467195884.24287.111.camel@perches.com> Subject: Re: [PATCH -v2 1/2] ratelimit: Extend to print suppressed messages on release From: Joe Perches To: Borislav Petkov , Ingo Molnar , Linus Torvalds , Steven Rostedt Cc: Greg Kroah-Hartman , Peter Zijlstra , Andrew Morton , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , Franck Bui , LKML Date: Wed, 29 Jun 2016 03:24:44 -0700 In-Reply-To: <1467194161-1472-2-git-send-email-bp@alien8.de> References: <1467194161-1472-1-git-send-email-bp@alien8.de> <1467194161-1472-2-git-send-email-bp@alien8.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 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 Wed, 2016-06-29 at 11:56 +0200, Borislav Petkov wrote: > From: Borislav Petkov > > Extend the ratelimiting facility to print the amount of suppressed lines > when it is being released. > > Separated from a previous patch by Linus. [] > diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h [] > @@ -15,6 +19,7 @@ struct ratelimit_state { >   int printed; >   int missed; >   unsigned long begin; > + unsigned long flags; >  }; There are a lot of ratelimit_state structs used in the kernel. Every printk like _ratelimited uses a static one. It'd likely be better to reduce the struct ratelimit_state size rather than expand it. burst and printed could probably become s16 or even s8. flags could be u8 until necessary to expand.