From: Jarek Poplawski <jarkao2@gmail.com>
To: Denys Fedoryshchenko <denys@visp.net.lb>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH]: Schedule correct qdisc in watchdog.
Date: Mon, 18 Aug 2008 17:55:32 +0200 [thread overview]
Message-ID: <20080818155532.GA2981@ami.dom.local> (raw)
In-Reply-To: <200808181545.30146.denys@visp.net.lb>
Denys Fedoryshchenko wrote, On 08/18/2008 02:45 PM:
> Patch applied, got another warning.
>
> [ 413.646102]
> [ 413.646102] =========================
> [ 413.646102] [ BUG: held lock freed! ]
> [ 413.646102] -------------------------
> [ 413.646102] pppd/4105 is freeing memory f6fe6e00-f6fe6eff, with a lock
> still held there!
> [ 413.646102] (&qdisc_rx_lock){-+..}, at: [<c026e3ab>]
> shutdown_scheduler_queue+0x1c/0x2e
...
Alas I can't find anything better for this than the previous patch
named "03-fix_patch_2.patch" in your repository. I attach it below
for any case (apply after all you currently had - there will be a
little offset warning while patching). Alternatively, you can wait
for David's opinion.
Jarek P.
---
include/linux/netdevice.h | 1 +
include/net/sch_generic.h | 5 ++++-
net/core/dev.c | 1 +
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 488c56e..7041c2c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -445,6 +445,7 @@ struct netdev_queue {
struct net_device *dev;
struct Qdisc *qdisc;
unsigned long state;
+ spinlock_t qdisc_lock;
spinlock_t _xmit_lock;
int xmit_lock_owner;
struct Qdisc *qdisc_sleeping;
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index a7abfda..f84e96c 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -185,7 +185,10 @@ static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb)
static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc)
{
- return &qdisc->q.lock;
+ if (unlikely(qdisc->flags & TCQ_F_BUILTIN))
+ return &qdisc->q.lock;
+
+ return &qdisc->dev_queue->qdisc_lock;
}
static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc)
diff --git a/net/core/dev.c b/net/core/dev.c
index 600bb23..9ec20e0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3859,6 +3859,7 @@ static void __netdev_init_queue_locks_one(struct net_device *dev,
void *_unused)
{
spin_lock_init(&dev_queue->_xmit_lock);
+ spin_lock_init(&dev_queue->qdisc_lock);
netdev_set_xmit_lockdep_class(&dev_queue->_xmit_lock, dev->type);
dev_queue->xmit_lock_owner = -1;
}
next prev parent reply other threads:[~2008-08-18 15:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-18 8:39 [PATCH]: Schedule correct qdisc in watchdog David Miller
2008-08-18 9:10 ` Jarek Poplawski
2008-08-18 9:31 ` David Miller
2008-08-18 9:47 ` Jarek Poplawski
2008-08-18 10:10 ` David Miller
2008-08-18 10:35 ` Jarek Poplawski
2008-08-18 10:43 ` Jarek Poplawski
2008-08-18 11:04 ` Denys Fedoryshchenko
2008-08-18 11:20 ` Jarek Poplawski
2008-08-18 11:35 ` Jarek Poplawski
2008-08-18 12:45 ` Denys Fedoryshchenko
2008-08-18 12:58 ` Jarek Poplawski
2008-08-18 23:56 ` David Miller
2008-08-19 5:37 ` Jarek Poplawski
2008-08-19 5:39 ` David Miller
2008-08-19 5:42 ` Jarek Poplawski
2008-08-18 15:55 ` Jarek Poplawski [this message]
2008-08-18 18:05 ` Denys Fedoryshchenko
2008-08-19 3:54 ` David Miller
2008-08-19 6:59 ` Jarek Poplawski
2008-08-19 7:03 ` David Miller
2008-08-18 11:06 ` Jarek Poplawski
2008-08-19 3:51 ` David Miller
2008-08-19 4:08 ` David Miller
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=20080818155532.GA2981@ami.dom.local \
--to=jarkao2@gmail.com \
--cc=davem@davemloft.net \
--cc=denys@visp.net.lb \
--cc=netdev@vger.kernel.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).