Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 1 Mar 2002 17:28:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 1 Mar 2002 17:28:04 -0500 Received: from ja.mac.ssi.bg ([212.95.166.194]:32004 "EHLO u.domain.uli") by vger.kernel.org with ESMTP id ; Fri, 1 Mar 2002 17:27:59 -0500 Date: Sat, 2 Mar 2002 00:27:40 +0000 (GMT) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: Kain cc: linux-kernel , Alexey Kuznetsov , Andi Kleen Subject: Re: OOPS: Multipath routing 2.4.17 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hello, Kain wrote: > impossible 888 > divide error: 0000 > > > EIP; c024c5ea <===== > Trace; c02232e8 There is no write locking in fib_select_multipath, combined with high rate of route resolutions and ... boom, fi->fib_power is 0: w = jiffies % fi->fib_power; What about a different algorithm to apply weighted round robin (idea mostly from LVS), something like this code (entirely not tested) where fi->fib_power is not used and where fib_sync_up and fib_sync_down don't need to play with nh_power on nh_flags change: void fib_select_multipath(const struct rt_key *key, struct fib_result *res) { struct fib_info *fi = res->fi; int w = -1, sel = 0; write_lock(&fib_info_lock); repeat: change_nexthops(fi) { if (nh->nh_power > w && !(nh->nh_flags&RTNH_F_DEAD)) { w = nh->nh_power; sel = nhsel; } } endfor_nexthops(fi); if (w > 0) { fi->fib_nh[sel].nh_power--; write_unlock(&fib_info_lock); res->nh_sel = sel; return; } if (!w) { change_nexthops(fi) { if (!(nh->nh_flags&RTNH_F_DEAD)) { nh->nh_power = nh->nh_weight; } } endfor_nexthops(fi); w = -1; goto repeat; } write_unlock(&fib_info_lock); #if 1 printk(KERN_CRIT "impossible 888\n"); #endif return; } Regards -- Julian Anastasov - 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/