From patchwork Thu May 21 10:19:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Olsson X-Patchwork-Id: 27485 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4A866B6F56 for ; Thu, 21 May 2009 20:19:30 +1000 (EST) Received: by ozlabs.org (Postfix) id 37A90DE1B5; Thu, 21 May 2009 20:19:30 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id B3EEBDE18D for ; Thu, 21 May 2009 20:19:29 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752124AbZEUKTV (ORCPT ); Thu, 21 May 2009 06:19:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751780AbZEUKTU (ORCPT ); Thu, 21 May 2009 06:19:20 -0400 Received: from robur.slu.se ([130.238.98.12]:57558 "EHLO robur.slu.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408AbZEUKTT (ORCPT ); Thu, 21 May 2009 06:19:19 -0400 Received: by robur.slu.se (Postfix, from userid 1000) id 33E96EC04C; Thu, 21 May 2009 12:19:20 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Message-ID: <18965.10920.161382.237618@robur.slu.se> Date: Thu, 21 May 2009 12:19:20 +0200 To: davem@davemloft.net Cc: Robert Olsson , NetDEV list , andrei.popa@i-neo.ro Subject: Re: [oops] with FIB_TRIE [PATCH] X-Mailer: VM 7.19 under Emacs 22.2.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, Andrei Popa: > clear ip bgp * soft" > when I have three full BGP sessions the kernel it oopses. > with CONFIG_PREEMPT=y It seems we can fix this by disabling preemption while we re-balance the trie. This is with the CONFIG_CLASSIC_RCU. It's been stress-tested at high loads continuesly taking a full BGP table up/down via iproute -batch. A patch is below. Note. fib_trie is not updated for CONFIG_PREEMPT_RCU Cheers --ro Signed-off-by: Robert Olsson --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index ec0ae49..33c7c85 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -986,9 +986,12 @@ fib_find_node(struct trie *t, u32 key) static struct node *trie_rebalance(struct trie *t, struct tnode *tn) { int wasfull; - t_key cindex, key = tn->key; + t_key cindex, key; struct tnode *tp; + preempt_disable(); + key = tn->key; + while (tn != NULL && (tp = node_parent((struct node *)tn)) != NULL) { cindex = tkey_extract_bits(key, tp->pos, tp->bits); wasfull = tnode_full(tp, tnode_get_child(tp, cindex)); @@ -1007,6 +1010,7 @@ static struct node *trie_rebalance(struct trie *t, struct tnode *tn) if (IS_TNODE(tn)) tn = (struct tnode *)resize(t, (struct tnode *)tn); + preempt_enable(); return (struct node *)tn; }