All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Badalian Vyacheslav <slavon@bigtelecom.ru>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: deadlocks if use htb
Date: Thu, 11 Dec 2008 08:46:06 +0000	[thread overview]
Message-ID: <20081211084606.GA4129@ff.dom.local> (raw)
In-Reply-To: <493FDCD4.5020108@bigtelecom.ru>

On Wed, Dec 10, 2008 at 06:14:28PM +0300, Badalian Vyacheslav wrote:
> Hello again! Sorry for long away.

Hi!

> I was go away from this work for long time.
> 
> May we return to this bug?
> Servers at last stable kernel 2.6.27.8
> HZ=1000, HR=off, DynamicTicks=off, hysteresis=1
> Sorry - no patched, update do not i. Do you have fresh patches or ideas
> for tests?

Not much, but I can have if you only are willing to test them...
I attach below a patch which combines 2 patches I sent yesterday to
netdev (PATCH 7/6 and 8/6) vs. 2.6.27.7 (named testing patch #3 here).

You can still try the testing patch #2 I sent previously (quoted below)
with or without this new #3 patch.

Thanks,
Jarek P.

> Also debug "Debug object operations" and "Debug timer objects" is on but
> i not see additional information at dump.
> 
> Thanks!
> 
> That dump:
> [ 1500.932813] BUG: NMI Watchdog detected LOCKUP on CPU3, ip c0208ed9,
> registers:
> [ 1500.932813] Modules linked in: cls_u32 sch_sfq sch_htb netconsole
> e1000e e1000 i2c_i801
> [ 1500.932813]
> [ 1500.932813] Pid: 0, comm: swapper Not tainted (2.6.27-gentoo-r5-fw #1)
> [ 1500.932813] EIP: 0060:[<c0208ed9>] EFLAGS: 00000082 CPU: 3
> [ 1500.932813] EIP is at rb_insert_color+0x29/0xf0
...
> > --- (testing patch #2)
> >
> >  net/sched/sch_htb.c |    8 +++++++-
> >  1 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
> > index 30c999c..ff9e965 100644


-----------> (testing patch #3)

diff -Nurp a2.6.27.7/net/sched/sch_htb.c b2.6.27.7/net/sched/sch_htb.c
--- a2.6.27.7/net/sched/sch_htb.c	2008-12-11 08:16:16.000000000 +0000
+++ b2.6.27.7/net/sched/sch_htb.c	2008-12-11 08:20:27.000000000 +0000
@@ -696,12 +696,13 @@ static void htb_charge_class(struct htb_
  * next pending event (0 for no event in pq).
  * Note: Applied are events whose have cl->pq_key <= q->now.
  */
-static psched_time_t htb_do_events(struct htb_sched *q, int level)
+static psched_time_t htb_do_events(struct htb_sched *q, int level,
+				   unsigned long start)
 {
 	/* don't run for longer than 2 jiffies; 2 is used instead of
 	   1 to simplify things when jiffy is going to be incremented
 	   too soon */
-	unsigned long stop_at = jiffies + 2;
+	unsigned long stop_at = start + 2;
 	while (time_before(jiffies, stop_at)) {
 		struct htb_class *cl;
 		long diff;
@@ -720,8 +721,8 @@ static psched_time_t htb_do_events(struc
 		if (cl->cmode != HTB_CAN_SEND)
 			htb_add_to_wait_tree(q, cl, diff);
 	}
-	/* too much load - let's continue on next jiffie */
-	return q->now + PSCHED_TICKS_PER_SEC / HZ;
+	/* too much load - let's continue on next jiffie (including above) */
+	return q->now + 2 * PSCHED_TICKS_PER_SEC / HZ;
 }
 
 /* Returns class->node+prio from id-tree where classe's id is >= id. NULL
@@ -880,6 +881,7 @@ static struct sk_buff *htb_dequeue(struc
 	struct htb_sched *q = qdisc_priv(sch);
 	int level;
 	psched_time_t next_event;
+	unsigned long start_at;
 
 	/* try to dequeue direct packets as high prio (!) to minimize cpu work */
 	skb = __skb_dequeue(&q->direct_queue);
@@ -892,6 +894,7 @@ static struct sk_buff *htb_dequeue(struc
 	if (!sch->q.qlen)
 		goto fin;
 	q->now = psched_get_time();
+	start_at = jiffies;
 
 	next_event = q->now + 5 * PSCHED_TICKS_PER_SEC;
 	q->nwc_hit = 0;
@@ -901,14 +904,14 @@ static struct sk_buff *htb_dequeue(struc
 		psched_time_t event;
 
 		if (q->now >= q->near_ev_cache[level]) {
-			event = htb_do_events(q, level);
+			event = htb_do_events(q, level, start_at);
 			if (!event)
 				event = q->now + PSCHED_TICKS_PER_SEC;
 			q->near_ev_cache[level] = event;
 		} else
 			event = q->near_ev_cache[level];
 
-		if (event && next_event > event)
+		if (next_event > event)
 			next_event = event;
 
 		m = ~q->row_mask[level];

  reply	other threads:[~2008-12-11  8:46 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-10  5:44 deadlocks if use htb Badalian Vyacheslav
2008-10-10  7:56 ` Jarek Poplawski
2008-10-10  8:46   ` Badalian Vyacheslav
2008-10-10  8:52   ` Badalian Vyacheslav
2008-10-10  9:04     ` Jarek Poplawski
2008-10-10  9:51       ` Jarek Poplawski
2008-10-16  8:28         ` Badalian Vyacheslav
2008-10-16  8:40           ` Jarek Poplawski
2008-10-22  6:06             ` Badalian Vyacheslav
2008-10-22  7:02               ` Jarek Poplawski
2008-12-10 15:14                 ` Badalian Vyacheslav
2008-12-11  8:46                   ` Jarek Poplawski [this message]
2008-12-15 11:13                     ` Jarek Poplawski
2008-12-16  7:37                       ` Badalian Vyacheslav
2008-12-18  6:43                       ` Badalian Vyacheslav
2008-12-18  8:17                         ` Jarek Poplawski
2008-12-18 11:23                           ` Badalian Vyacheslav
2008-12-18 11:37                             ` Jarek Poplawski
2009-01-14  2:43                           ` Chris Caputo
2009-01-14  6:39                             ` Jarek Poplawski
2009-01-14 12:17                               ` Denys Fedoryschenko
2009-01-14 12:36                                 ` Jarek Poplawski
2009-01-14 12:41                                   ` Denys Fedoryschenko
2009-01-14 12:50                                 ` Peter Zijlstra
2009-01-14 13:04                                   ` Jarek Poplawski
2009-01-14 13:05                                   ` Denys Fedoryschenko
2009-01-14 13:12                                     ` Jarek Poplawski
2009-01-14 13:15                                       ` Peter Zijlstra
2009-01-14 13:19                                         ` Denys Fedoryschenko
2009-01-14 13:26                                         ` Jarek Poplawski
2009-01-14 13:32                                           ` Peter Zijlstra
2009-01-14 13:57                                             ` Jarek Poplawski
2009-01-14 14:13                                             ` Jarek Poplawski
2009-01-14 14:28                                               ` Peter Zijlstra
2009-01-14 14:39                                                 ` Jarek Poplawski
2009-01-15  9:01                                                 ` Jarek Poplawski
2009-01-15 10:46                                                   ` Peter Zijlstra
2009-01-15 10:54                                                     ` Jarek Poplawski
2009-01-14 18:02                                   ` Chris Caputo
2009-01-15  6:53                                     ` Jarek Poplawski
2009-01-15  7:12                                       ` Badalian Vyacheslav
2009-01-15  8:09                                         ` Jarek Poplawski
2009-01-15  9:01                                           ` Denys Fedoryschenko
2009-01-15  9:06                                             ` Jarek Poplawski
2009-01-15  9:40                                               ` Badalian Vyacheslav
2009-01-15  9:54                                                 ` Jarek Poplawski
2009-01-15  9:57                                                   ` Denys Fedoryschenko
2009-01-15 10:06                                                     ` Jarek Poplawski
2009-01-15 10:10                                                     ` Jarek Poplawski
2009-01-15 10:40                                                       ` Denys Fedoryschenko
2009-01-15  7:26                                       ` Chris Caputo
2009-01-15  7:54                                         ` Jarek Poplawski
2009-01-15  9:45                                           ` Jarek Poplawski
2009-01-15 12:00                                             ` Chris Caputo
2009-01-15 12:18                                               ` Jarek Poplawski
2009-01-15 13:53                                                 ` Chris Caputo
2009-01-16  6:51                                                   ` Badalian Vyacheslav
2009-01-19  5:46                                       ` David Miller
2009-01-19  6:57                                         ` [PATCH] " Jarek Poplawski
2009-01-19  7:42                                           ` Badalian Vyacheslav
2009-01-19  7:57                                             ` Jarek Poplawski
2009-01-20  1:29                                               ` David Miller
2008-10-10 12:32   ` Patrick McHardy
2008-10-10 12:34     ` Patrick McHardy
2008-10-10 12:54       ` Badalian Vyacheslav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081211084606.GA4129@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=slavon@bigtelecom.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.