From: Anton Blanchard <anton@samba.org>
To: netdev@oss.sgi.com
Cc: miltonm@bga.com
Subject: [PATCH] fix NAPI race
Date: Tue, 29 Jul 2003 16:05:09 +1000 [thread overview]
Message-ID: <20030729060509.GB13227@krispykreme> (raw)
Hi,
Milton and I debugged an oops where we did list_del on a poisoned list
entry. It turns out there is nothing to order between list_del on
poll_list and the clear_bit that serialises list_add.
Anton
diff -ruN --exclude-from=exclude gr13_work/include/linux/netdevice.h gr13_work_miltonm/include/linux/netdevice.h
--- gr13_work/include/linux/netdevice.h 2003-07-17 23:30:43.000000000 -0500
+++ gr13_work_miltonm/include/linux/netdevice.h 2003-07-28 23:42:06.000000000 -0500
@@ -820,6 +820,7 @@
local_irq_save(flags);
if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
list_del(&dev->poll_list);
+ smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
local_irq_restore(flags);
}
diff -ruN --exclude-from=exclude gr13_work/net/core/dev.c gr13_work_miltonm/net/core/dev.c
--- gr13_work/net/core/dev.c 2003-07-17 23:30:43.000000000 -0500
+++ gr13_work_miltonm/net/core/dev.c 2003-07-28 23:40:15.000000000 -0500
@@ -1657,6 +1657,7 @@
*budget -= work;
list_del(&backlog_dev->poll_list);
+ smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_RX_SCHED, &backlog_dev->state);
if (queue->throttle) {
diff -ruN --exclude-from=exclude gr13_work/drivers/net/tg3.c gr13_work_miltonm/drivers/net/tg3.c
--- gr13_work/drivers/net/tg3.c 2003-07-13 23:40:19.000000000 -0500
+++ gr13_work_miltonm/drivers/net/tg3.c 2003-07-29 01:00:32.000000000 -0500
@@ -250,6 +250,7 @@
{
if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
list_del(&dev->poll_list);
+ smp_mb__before_clear_bit();
clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
}
next reply other threads:[~2003-07-29 6:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-29 6:05 Anton Blanchard [this message]
2003-07-30 5:22 ` [PATCH] fix NAPI race David S. 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=20030729060509.GB13227@krispykreme \
--to=anton@samba.org \
--cc=miltonm@bga.com \
--cc=netdev@oss.sgi.com \
/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).