Netdev List
 help / color / mirror / Atom feed
* [PATCH] drop_monitor: allow more events per second
@ 2012-04-19 17:16 Eric Dumazet
  2012-04-19 17:28 ` Neil Horman
  2012-04-21 20:29 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Dumazet @ 2012-04-19 17:16 UTC (permalink / raw)
  To: Neil Horman, David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

It seems there is a logic error in trace_drop_common(), since we store
only 64 drops, even if they are from same location.

This fix is a one liner, but we probably need more work to avoid useless
atomic dec/inc

Now I can watch 1 Mpps drops through dropwatch...

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
---
Neil, it seems this code is not SMP/preempt safe. Worker can free our
data under us, and genlmsg_new() can return NULL under stress.

 net/core/drop_monitor.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 7f36b38..5c3c81a 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -150,6 +150,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
 	for (i = 0; i < msg->entries; i++) {
 		if (!memcmp(&location, msg->points[i].pc, sizeof(void *))) {
 			msg->points[i].count++;
+			atomic_inc(&data->dm_hit_count);
 			goto out;
 		}
 	}

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-21 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-19 17:16 [PATCH] drop_monitor: allow more events per second Eric Dumazet
2012-04-19 17:28 ` Neil Horman
2012-04-19 21:25   ` Eric Dumazet
2012-04-20 13:06     ` Neil Horman
2012-04-21 20:29 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox