Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1475199
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/5] u64_stats: Introduce IRQs disabled helpers |
| Date | 2016-09-02 16:40 +0200 |
| Message-ID | <scXNo-El-11@gated-at.bofh.it> (permalink) |
| References | <scXkm-s8-19@gated-at.bofh.it> <scXkm-s8-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 02/09/2016 16:03, Frederic Weisbecker wrote:
> static inline unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp)
> {
> -#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
> - return read_seqcount_begin(&syncp->seq);
> -#else
> -#if BITS_PER_LONG==32
> +#if BITS_PER_LONG==32 && !defined(CONFIG_SMP)
> preempt_disable();
> +#else
This should be #endif, or this side ends without a "return" statement.
> + return __u64_stats_fetch_begin(syncp);
> #endif
> - return 0;
> +}
...
>
> static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp,
> unsigned int start)
> {
> -#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
> - return read_seqcount_retry(&syncp->seq, start);
> -#else
> -#if BITS_PER_LONG==32
> +#if BITS_PER_LONG==32 && !defined(CONFIG_SMP)
> preempt_enable();
> -#endif
> - return false;
> +#else
Same here.
> + return __u64_stats_fetch_retry(syncp, start);
> #endif
> }
...
>
> - return read_seqcount_begin(&syncp->seq);
> -#else
> -#if BITS_PER_LONG==32
> +#if BITS_PER_LONG==32 && !defined(CONFIG_SMP)
> local_irq_disable();
> -#endif
> - return 0;
> +#else
Same here.
> + return __u64_stats_fetch_begin(syncp);
> #endif
>
> -#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
> - return read_seqcount_retry(&syncp->seq, start);
> -#else
> -#if BITS_PER_LONG==32
> +#if BITS_PER_LONG==32 && !defined(CONFIG_SMP)
> local_irq_enable();
> -#endif
> - return false;
> +#else
Same here.
> + return __u64_stats_fetch_retry(syncp, start);
> #endif
Thanks,
Paolo
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] sched/cputime: irqtime cleanups Frederic Weisbecker <fweisbec@gmail.com> - 2016-09-02 16:10 +0200
[PATCH 1/5] irqtime: No need for preempt-safe accessors Frederic Weisbecker <fweisbec@gmail.com> - 2016-09-02 16:10 +0200
Re: [PATCH 1/5] irqtime: No need for preempt-safe accessors Rik van Riel <riel@redhat.com> - 2016-09-06 19:10 +0200
[PATCH 2/5] irqtime: Remove needless IRQs disablement on kcpustat update Frederic Weisbecker <fweisbec@gmail.com> - 2016-09-02 16:10 +0200
Re: [PATCH 2/5] irqtime: Remove needless IRQs disablement on kcpustat update Paolo Bonzini <pbonzini@redhat.com> - 2016-09-02 17:00 +0200
Re: [PATCH 2/5] irqtime: Remove needless IRQs disablement on kcpustat update Peter Zijlstra <peterz@infradead.org> - 2016-09-02 18:40 +0200
Re: [PATCH 2/5] irqtime: Remove needless IRQs disablement on kcpustat update Rik van Riel <riel@redhat.com> - 2016-09-06 19:10 +0200
Re: [PATCH 2/5] irqtime: Remove needless IRQs disablement on kcpustat update Peter Zijlstra <peterz@infradead.org> - 2016-09-07 10:00 +0200
[PATCH 3/5] u64_stats: Introduce IRQs disabled helpers Frederic Weisbecker <fweisbec@gmail.com> - 2016-09-02 16:10 +0200
Re: [PATCH 3/5] u64_stats: Introduce IRQs disabled helpers Paolo Bonzini <pbonzini@redhat.com> - 2016-09-02 16:40 +0200
[PATCH 5/5] irqtime: Consolidate irqtime flushing code Frederic Weisbecker <fweisbec@gmail.com> - 2016-09-02 16:10 +0200
Re: [PATCH 5/5] irqtime: Consolidate irqtime flushing code Rik van Riel <riel@redhat.com> - 2016-09-06 19:00 +0200
csiph-web