lkml.org 
[lkml]   [2017]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next] net: dsa: User per-cpu 64-bit statistics
From
Date
On Fri, 2017-08-04 at 10:11 -0700, Eric Dumazet wrote:

> You could add a debug version of u64_stats_update_begin()
>
> doing
>
> int ret = atomic_inc((atomic_t *)syncp);

I meant atomic_inc_return() of course.

>
> BUG_ON(ret & 1);
>
>
> And u64_stats_update_end()
>
> int ret = atomic_inc((atomic_t *)syncp);
>
> BUG_ON(!(ret & 1));
>
>
> We probably could have a CONFIG_DEBUG_U64_STATS that could be used on
> 64bit kernels as well...
>
>
>


\
 
 \ /
  Last update: 2017-08-04 19:43    [W:0.311 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site