Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760769AbYB1Skr (ORCPT ); Thu, 28 Feb 2008 13:40:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752699AbYB1Skh (ORCPT ); Thu, 28 Feb 2008 13:40:37 -0500 Received: from smtp1.linux-foundation.org ([207.189.120.13]:50252 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751657AbYB1Skg (ORCPT ); Thu, 28 Feb 2008 13:40:36 -0500 Date: Thu, 28 Feb 2008 10:39:55 -0800 From: Andrew Morton To: "Hawkes Steve-FSH016" Cc: , , , Subject: Re: printk_ratelimit and net_ratelimit conflict and tunable behavior Message-Id: <20080228103955.570ade3e.akpm@linux-foundation.org> In-Reply-To: <7BFDACCD6948EF4D8FE8F4888A91596A01637208@tx14exm60.ds.mot.com> References: <200802252036.m1PKaeMY012587@ftw.mot.com> <20080225154521.e119cbb6.akpm@linux-foundation.org> <7BFDACCD6948EF4D8FE8F4888A91596A01637208@tx14exm60.ds.mot.com> X-Mailer: Sylpheed 2.4.1 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1813 Lines: 52 On Thu, 28 Feb 2008 10:19:02 -0600 "Hawkes Steve-FSH016" wrote: > Andrew Morton wrote: > > > This patch causes a large and nasty reject. > > Probably because you patched 2.6.24. We're developing 2.6.25 now, and > > the difference between the two is very large inded. Please raise > patches > > against Linus's latest tree? > > Will do. I'm learning the process. I assume Linus's latest tree is the > one > listed as the latest prepatch for the stable Linux kernel tree. No, the stable tree is 2.6.24. You'll want ftp://ftp.kernel.org/pub/linux/kernel/v2.6/snapshots/ > > > int net_ratelimit(void) > > > { > > > - return __printk_ratelimit(net_msg_cost, net_msg_burst); > > > + static struct printk_ratelimit_state limit_state = { > > > + .toks = 10 * 5 * HZ, > > > + .last_jiffies = 0, > > > + .missed = 0, > > > + .limit_jiffies = 5 * HZ, > > > + .limit_burst = 10, > > > + .facility = "net" > > > + }; > > > + > > > + return __printk_ratelimit(net_msg_cost, net_msg_burst, > &limit_state); > > > > I don't get it. There's one instance of limit_state, kernel-wide, and > > __printk_ratelimit() modifies it. What prevents one CPU's activities > from > > interfering with a second CPU's activities? > > The state is protected by the spinlock in __printk_ratelimit, like it is > in > the current kernel. Am I missing something? ah, OK. I've occasionally wondered if ratelimiting should be per-callsite rather than kernel-wide, but I'm not aware of the present setup causing anyone any problems. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/