lkml.org 
[lkml]   [2010]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] Basic zcache functionality
Nitin Gupta wrote:
> +static void zcache_add_stat(struct zcache_pool *zpool,
> + enum zcache_pool_stats_index idx, s64 val)
> +{
> + struct zcache_pool_stats_cpu *stats;
> +
> + preempt_disable();
> + stats = __this_cpu_ptr(zpool->stats);
> + u64_stats_update_begin(&stats->syncp);
> + stats->count[idx] += val;
> + u64_stats_update_end(&stats->syncp);
> + preempt_enable();
> +
> +}

You should probably use this_cpu_inc() here.


\
 
 \ /
  Last update: 2010-07-18 10:29    [W:0.108 / U:1.880 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site