Lines Matching +full:start +full:- +full:up
1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Protect against 64-bit values tearing on 32-bit architectures. This is
11 * - Use a seqcount on 32-bit SMP, only disable preemption for 32-bit UP.
12 * - The whole thing is a no-op on 64-bit architectures.
34 * seqcounts are not used for UP kernels). 32-bit UP stat readers could read
35 * corrupted 64-bit values otherwise.
45 * u64_stats_update_begin(&stats->syncp);
46 * u64_stats_add(&stats->bytes64, len); // non atomic operation
47 * u64_stats_inc(&stats->packets64); // non atomic operation
48 * u64_stats_update_end(&stats->syncp);
54 * unsigned int start;
57 * start = u64_stats_fetch_begin(&stats->syncp);
58 * tbytes = u64_stats_read(&stats->bytes64); // non atomic operation
59 * tpackets = u64_stats_read(&stats->packets64); // non atomic operation
60 * } while (u64_stats_fetch_retry(&stats->syncp, start));
83 return local64_read(&p->v); in u64_stats_read()
88 local64_add(val, &p->v); in u64_stats_add()
93 local64_inc(&p->v); in u64_stats_inc()
104 return p->v; in u64_stats_read()
109 p->v += val; in u64_stats_add()
114 p->v++; in u64_stats_inc()
121 seqcount_init(&syncp->seq); in u64_stats_init()
128 write_seqcount_begin(&syncp->seq); in u64_stats_update_begin()
135 write_seqcount_end(&syncp->seq); in u64_stats_update_end()
146 write_seqcount_begin(&syncp->seq); in u64_stats_update_begin_irqsave()
156 write_seqcount_end(&syncp->seq); in u64_stats_update_end_irqrestore()
164 return read_seqcount_begin(&syncp->seq); in __u64_stats_fetch_begin()
179 unsigned int start) in __u64_stats_fetch_retry() argument
182 return read_seqcount_retry(&syncp->seq, start); in __u64_stats_fetch_retry()
189 unsigned int start) in u64_stats_fetch_retry() argument
194 return __u64_stats_fetch_retry(syncp, start); in u64_stats_fetch_retry()
199 * - SMP 32bit arches use seqcount protection, irq safe.
200 * - UP 32bit must disable irqs.
201 * - 64bit have no problem atomically reading u64 values, irq safe.
212 unsigned int start) in u64_stats_fetch_retry_irq() argument
217 return __u64_stats_fetch_retry(syncp, start); in u64_stats_fetch_retry_irq()