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()
119 #define u64_stats_init(syncp) seqcount_init(&(syncp)->seq)
129 write_seqcount_begin(&syncp->seq); in u64_stats_update_begin()
136 write_seqcount_end(&syncp->seq); in u64_stats_update_end()
147 write_seqcount_begin(&syncp->seq); in u64_stats_update_begin_irqsave()
157 write_seqcount_end(&syncp->seq); in u64_stats_update_end_irqrestore()
165 return read_seqcount_begin(&syncp->seq); in __u64_stats_fetch_begin()
180 unsigned int start) in __u64_stats_fetch_retry() argument
183 return read_seqcount_retry(&syncp->seq, start); in __u64_stats_fetch_retry()
190 unsigned int start) in u64_stats_fetch_retry() argument
195 return __u64_stats_fetch_retry(syncp, start); in u64_stats_fetch_retry()
200 * - SMP 32bit arches use seqcount protection, irq safe.
201 * - UP 32bit must disable irqs.
202 * - 64bit have no problem atomically reading u64 values, irq safe.
213 unsigned int start) in u64_stats_fetch_retry_irq() argument
218 return __u64_stats_fetch_retry(syncp, start); in u64_stats_fetch_retry_irq()