From patchwork Fri Oct 10 07:56:40 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 3696 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org 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 755BEDDEF2 for ; Fri, 10 Oct 2008 18:56:52 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbYJJH4s (ORCPT ); Fri, 10 Oct 2008 03:56:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752655AbYJJH4s (ORCPT ); Fri, 10 Oct 2008 03:56:48 -0400 Received: from ug-out-1314.google.com ([66.249.92.173]:45104 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495AbYJJH4r (ORCPT ); Fri, 10 Oct 2008 03:56:47 -0400 Received: by ug-out-1314.google.com with SMTP id k3so1210450ugf.37 for ; Fri, 10 Oct 2008 00:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=BeZoglbmaeWXdnnP/7FrTSDVzIKmLD/BTr+mwAP7zFU=; b=qaKVrbDWOaMNaTgJALHC466NMYxJNObk+M3zU/24zDsS8lE2zZZGoNDuRvzdgA9Jsz D0FNOMlS4fAtr9U0TFL2GJMOKbtjaZZLgu6I7/B8FSvDMtH0wg8Alm+edJbxgae2bdLI RyA/7j5XuQRAymAI/LBV1IAVVajbRZPB2fY5Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:in-reply-to:user-agent; b=QMfjgtDsp6ah6zBABF2x1fD8OYEXqZ4fg9C7HDhIcPQ8B64betDsAL5gFDF6TU8JJr oFmZzzt0E+S6dWJFTVKHtdXW1etyarHuFjOJ2y55mWn0CHNlPLFob47geYZVKGb8G7Pl NLfP1CCcLXsKpInBiDceesGUyYKGvbuhOvKlo= Received: by 10.67.87.11 with SMTP id p11mr373461ugl.41.1223625405393; Fri, 10 Oct 2008 00:56:45 -0700 (PDT) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id s7sm8604389uge.24.2008.10.10.00.56.44 (version=SSLv3 cipher=RC4-MD5); Fri, 10 Oct 2008 00:56:44 -0700 (PDT) Date: Fri, 10 Oct 2008 07:56:40 +0000 From: Jarek Poplawski To: Badalian Vyacheslav Cc: netdev@vger.kernel.org Subject: Re: deadlocks if use htb Message-ID: <20081010075640.GA5204@ff.dom.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <48EEEBC1.2090008@bigtelecom.ru> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 10-10-2008 07:44, Badalian Vyacheslav wrote: > Hello all! Hello Slavon, > > Please look to if you have time: > http://bugzilla.kernel.org/show_bug.cgi?id=11718 > > We have deadlocks at few PC one times in week. > I can test any patches to detect and fix problem. > Now i test 2.6.27-rc kernel at one PC. A similar bug was reported by Denys Fedoryshchenko but it wasn't fully diagnosed. Anyway it looks like hardware dependent. The patch below can sometimes help. 2.6.27 may have this fixed too (some other way). Jarek P. (some offsets are OK when patching 2.6.26) --- net/sched/sch_htb.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) -- 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/sched/sch_htb.c b/net/sched/sch_htb.c index 30c999c..ff9e965 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -162,6 +162,7 @@ struct htb_sched { int rate2quantum; /* quant = rate / rate2quantum */ psched_time_t now; /* cached dequeue time */ + psched_time_t next_watchdog; struct qdisc_watchdog watchdog; /* non shaped skbs; let them go directly thru */ @@ -920,7 +921,11 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) } } sch->qstats.overlimits++; - qdisc_watchdog_schedule(&q->watchdog, next_event); + if (q->next_watchdog < q->now || next_event <= + q->next_watchdog - PSCHED_TICKS_PER_SEC / HZ) { + qdisc_watchdog_schedule(&q->watchdog, next_event); + q->next_watchdog = next_event; + } fin: return skb; } @@ -973,6 +978,7 @@ static void htb_reset(struct Qdisc *sch) } } qdisc_watchdog_cancel(&q->watchdog); + q->next_watchdog = 0; __skb_queue_purge(&q->direct_queue); sch->q.qlen = 0; memset(q->row, 0, sizeof(q->row));