Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764223AbYBUL30 (ORCPT ); Thu, 21 Feb 2008 06:29:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752903AbYBUL3P (ORCPT ); Thu, 21 Feb 2008 06:29:15 -0500 Received: from viefep31-int.chello.at ([62.179.121.49]:59763 "EHLO viefep31-int.chello.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752630AbYBUL3N (ORCPT ); Thu, 21 Feb 2008 06:29:13 -0500 Message-ID: <47BD6072.4000407@trash.net> Date: Thu, 21 Feb 2008 12:28:50 +0100 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.6 (X11/20071008) MIME-Version: 1.0 To: Tilman Schmidt CC: Andrew Morton , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org Subject: Re: 2.6.25-rc2-mm1 - several bugs and a crash References: <20080216002522.9c4bd0fb.akpm@linux-foundation.org> <47BC982C.7050402@imap.cc> In-Reply-To: <47BC982C.7050402@imap.cc> Content-Type: multipart/mixed; boundary="------------020401060508010500060202" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3865 Lines: 105 This is a multi-part message in MIME format. --------------020401060508010500060202 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Tilman Schmidt wrote: > Still, X came up fine, I could log in (Gnome feeling subjectively > a bit sluggish), call up a web page from the Internet in Firefox, > and start perusing the logs, when the whole system froze: neither > mouse nor keyboard would react anymore, and only the Wind^Wreset > button would put me back in control. After rebooting into the > previous, non-mm kernel I found this in the syslog: > > Feb 20 17:22:40 xenon kernel: [ 48.180297] BUG: using smp_processor_id() in preemptible [00000000] code: ntpdate/3562 > Feb 20 17:22:40 xenon kernel: [ 48.180297] caller is __nf_conntrack_find+0x9b/0xeb [nf_conntrack] > Feb 20 17:22:40 xenon kernel: [ 48.180297] Pid: 3562, comm: ntpdate Not tainted 2.6.25-rc2-mm1-testing #1 > Feb 20 17:22:40 xenon kernel: [ 48.180297] [] debug_smp_processor_id+0x99/0xb0 Could you test whether this patch fixes the netfilter warnings please? --------------020401060508010500060202 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" commit 736b33102292be0d75be1e950ca9bcd5361db7dd Author: Patrick McHardy Date: Thu Feb 21 12:26:01 2008 +0100 [NETFILTER]: nf_conntrack: fix smp_processor_id() in preemptible code warning Since we're using RCU for the conntrack hash now, we need to avoid getting preempted or interrupted by BHs while changing the stats. Fixes warning reported by Tilman Schmidt when using preemptible RCU: [ 48.180297] BUG: using smp_processor_id() in preemptible [00000000] code: ntpdate/3562 [ 48.180297] caller is __nf_conntrack_find+0x9b/0xeb [nf_conntrack] [ 48.180297] Pid: 3562, comm: ntpdate Not tainted 2.6.25-rc2-mm1-testing #1 [ 48.180297] [] debug_smp_processor_id+0x99/0xb0 [ 48.180297] [] __nf_conntrack_find+0x9b/0xeb [nf_conntrack] Signed-off-by: Patrick McHardy diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 327e847..b77eb56 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -256,13 +256,19 @@ __nf_conntrack_find(const struct nf_conntrack_tuple *tuple) struct hlist_node *n; unsigned int hash = hash_conntrack(tuple); + /* Disable BHs the entire time since we normally need to disable them + * at least once for the stats anyway. + */ + local_bh_disable(); hlist_for_each_entry_rcu(h, n, &nf_conntrack_hash[hash], hnode) { if (nf_ct_tuple_equal(tuple, &h->tuple)) { NF_CT_STAT_INC(found); + local_bh_enable(); return h; } NF_CT_STAT_INC(searched); } + local_bh_enable(); return NULL; } @@ -400,17 +406,20 @@ nf_conntrack_tuple_taken(const struct nf_conntrack_tuple *tuple, struct hlist_node *n; unsigned int hash = hash_conntrack(tuple); - rcu_read_lock(); + /* Disable BHs the entire time since we need to disable them at + * least once for the stats anyway. + */ + rcu_read_lock_bh(); hlist_for_each_entry_rcu(h, n, &nf_conntrack_hash[hash], hnode) { if (nf_ct_tuplehash_to_ctrack(h) != ignored_conntrack && nf_ct_tuple_equal(tuple, &h->tuple)) { NF_CT_STAT_INC(found); - rcu_read_unlock(); + rcu_read_unlock_bh(); return 1; } NF_CT_STAT_INC(searched); } - rcu_read_unlock(); + rcu_read_unlock_bh(); return 0; } --------------020401060508010500060202-- -- 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/