aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/event_analyzing_sample.py
diff options
context:
space:
mode:
authorwilly tarreau <[email protected]>2014-01-16 08:20:08 +0100
committerDavid S. Miller <[email protected]>2014-01-16 15:15:42 -0800
commit74c41b048db1073a04827d7f39e95ac1935524cc (patch)
tree35b02acdb0ce1954f4b37afcb8a2644b629f4146 /tools/perf/scripts/python/event_analyzing_sample.py
parentdc4277dd41a80fd5f29a90412ea04bc3ba54fbf1 (diff)
net: mvneta: use per_cpu stats to fix an SMP lock up
Stats writers are mvneta_rx() and mvneta_tx(). They don't lock anything when they update the stats, and as a result, it randomly happens that the stats freeze on SMP if two updates happen during stats retrieval. This is very easily reproducible by starting two HTTP servers and binding each of them to a different CPU, then consulting /proc/net/dev in loops during transfers, the interface should immediately lock up. This issue also randomly happens upon link state changes during transfers, because the stats are collected in this situation, but it takes more attempts to reproduce it. The comments in netdevice.h suggest using per_cpu stats instead to get rid of this issue. This patch implements this. It merges both rx_stats and tx_stats into a single "stats" member with a single syncp. Both mvneta_rx() and mvneta_rx() now only update the a single CPU's counters. In turn, mvneta_get_stats64() does the summing by iterating over all CPUs to get their respective stats. With this change, stats are still correct and no more lockup is encountered. Note that this bug was present since the first import of the mvneta driver. It might make sense to backport it to some stable trees. If so, it depends on "d33dc73 net: mvneta: increase the 64-bit rx/tx stats out of the hot path". Cc: Thomas Petazzoni <[email protected]> Cc: Gregory CLEMENT <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Tested-by: Arnaud Ebalard <[email protected]> Signed-off-by: Willy Tarreau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions