diff options
Diffstat (limited to 'include/linux/u64_stats_sync.h')
-rw-r--r-- | include/linux/u64_stats_sync.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index d0505156ed5..b38e3a58de8 100644 --- a/include/linux/u64_stats_sync.h +++ b/include/linux/u64_stats_sync.h | |||
@@ -23,6 +23,10 @@ | |||
23 | * pure reads. But if they have to fetch many values, it's better to not allow | 23 | * pure reads. But if they have to fetch many values, it's better to not allow |
24 | * preemptions/interruptions to avoid many retries. | 24 | * preemptions/interruptions to avoid many retries. |
25 | * | 25 | * |
26 | * 6) If counter might be written by an interrupt, readers should block interrupts. | ||
27 | * (On UP, there is no seqcount_t protection, a reader allowing interrupts could | ||
28 | * read partial values) | ||
29 | * | ||
26 | * Usage : | 30 | * Usage : |
27 | * | 31 | * |
28 | * Stats producer (writer) should use following template granted it already got | 32 | * Stats producer (writer) should use following template granted it already got |
@@ -46,7 +50,7 @@ | |||
46 | * start = u64_stats_fetch_begin(&stats->syncp); | 50 | * start = u64_stats_fetch_begin(&stats->syncp); |
47 | * tbytes = stats->bytes64; // non atomic operation | 51 | * tbytes = stats->bytes64; // non atomic operation |
48 | * tpackets = stats->packets64; // non atomic operation | 52 | * tpackets = stats->packets64; // non atomic operation |
49 | * } while (u64_stats_fetch_retry(&stats->lock, syncp)); | 53 | * } while (u64_stats_fetch_retry(&stats->syncp, start)); |
50 | * | 54 | * |
51 | * | 55 | * |
52 | * Example of use in drivers/net/loopback.c, using per_cpu containers, | 56 | * Example of use in drivers/net/loopback.c, using per_cpu containers, |