From: Thomas Graf <tgraf@suug.ch>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: hadi@cyberus.ca, netdev <netdev@oss.sgi.com>,
Tarhon-Onu Victor <mituc@iasi.rdsnet.ro>,
kuznet@ms2.inr.ac.ru, devik@cdi.cz, linux-kernel@vger.kernel.org,
Patrick McHardy <kaber@trash.net>
Subject: Re: ACPI/HT or Packet Scheduler BUG?
Date: Sat, 16 Apr 2005 00:54:22 +0200 [thread overview]
Message-ID: <20050415225422.GF4114@postel.suug.ch> (raw)
In-Reply-To: <1113602052.4294.89.camel@localhost.localdomain>
* Steven Rostedt <1113602052.4294.89.camel@localhost.localdomain> 2005-04-15 17:54
> > ==
> > list_for_each_entry(cq, &cql, list)
> > list_for_each_entry_safe(q, n, &qdisc->dev->qdisc_list, list)
> > if (TC_H_MAJ(q->parent) == TC_H_MAJ(cq->handle)) {
> > if (q->ops->cl_ops == NULL)
> > list_del_init(&q->list);
> > else
> > list_move_tail(&q->list, &cql);
> > }
> > list_for_each_entry_safe(cq, n, &cql, list)
> > list_del_init(&cq->list);
> > ==
> >
> > ...and it happens when q->ops->cl_ops is NULL and
> > list_del_init(&q->list) is executed.
> >
> > The stuff from include/linux/list.h looks ok, it seems like one
> > of those two iterations (list_for_each_entry() and
> > list_for_each_entry_safe()) enters an endless loop when an element is
> > removed from the list under some circumstances.
>
> There's a comment above qdisc_destroy that says:
>
> /* Under dev->queue_lock and BH! */
>
> I'm not so sure this is the case.
It's not, we should change the comment. qdisc_destroy calls for inner
leaf qdiscs comming from rcu scheduled __qdisc_destroy -> qdisc::destroy()
-> qdisc_destroy() will not have a lock on queue_lock but it shouldn't be
a problem since the qdiscs cannot be found anymore.
Another case were it's not locked is upon a deletion of a class where
the class deletes its inner qdisc, although there is only one case
how this can happen and that's under rtnl semaphore so there is no
way we can have a dumper at the same time.
A wild guess would be that one of the many wrong locking places where
dev->queue_lock is acquired but qdisc_tree_lock is not is the problem.
tc_dump_qdisc assumed that locking on qdisc_tree_lock is enough which
is absolutely right, still most callers to qdisc_destroy only lock
on dev->queue_lock for the modification of the tree, which _was_ fine
before we used list.h since the unlinking was atomic. This is no news
and Patrick's patch in 2.6.10 ought to have fixed this by unlinking
inner leaf qdiscs from dev->qdisc_list and thus preventing them to
be found by anyone during unlocked calls to destroy_qdisc.
So... we might have a unlocked qdisc_destroy call for a qdisc not
properly unlinked from dev->qdisc_list.
next prev parent reply other threads:[~2005-04-15 22:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.61.0504081225510.27991@blackblue.iasi.rdsnet.ro>
[not found] ` <Pine.LNX.4.61.0504121526550.4822@blackblue.iasi.rdsnet.ro>
[not found] ` <Pine.LNX.4.61.0504141840420.13546@blackblue.iasi.rdsnet.ro>
[not found] ` <1113601029.4294.80.camel@localhost.localdomain>
2005-04-15 21:44 ` ACPI/HT or Packet Scheduler BUG? jamal
2005-04-15 21:54 ` Steven Rostedt
2005-04-15 22:54 ` Thomas Graf [this message]
2005-04-16 1:49 ` Herbert Xu
2005-04-16 5:01 ` Steven Rostedt
2005-04-16 11:06 ` Thomas Graf
2005-04-16 11:12 ` Herbert Xu
2005-04-17 17:46 ` Patrick McHardy
2005-04-17 21:37 ` Herbert Xu
2005-04-16 11:23 ` Herbert Xu
2005-04-16 11:34 ` Thomas Graf
2005-04-16 16:04 ` jamal
2005-04-16 18:21 ` Thomas Graf
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=20050415225422.GF4114@postel.suug.ch \
--to=tgraf@suug.ch \
--cc=devik@cdi.cz \
--cc=hadi@cyberus.ca \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mituc@iasi.rdsnet.ro \
--cc=netdev@oss.sgi.com \
--cc=rostedt@goodmis.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).