Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738Ab0GRI1b (ORCPT ); Sun, 18 Jul 2010 04:27:31 -0400 Received: from courier.cs.helsinki.fi ([128.214.9.1]:59442 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532Ab0GRI12 (ORCPT ); Sun, 18 Jul 2010 04:27:28 -0400 Message-ID: <4C42BAE5.9020606@cs.helsinki.fi> Date: Sun, 18 Jul 2010 11:27:17 +0300 From: Pekka Enberg User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Nitin Gupta CC: Hugh Dickins , Andrew Morton , Greg KH , Dan Magenheimer , Rik van Riel , Avi Kivity , Christoph Hellwig , Minchan Kim , Konrad Rzeszutek Wilk , linux-mm , linux-kernel Subject: Re: [PATCH 2/8] Basic zcache functionality References: <1279283870-18549-1-git-send-email-ngupta@vflare.org> <1279283870-18549-3-git-send-email-ngupta@vflare.org> In-Reply-To: <1279283870-18549-3-git-send-email-ngupta@vflare.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 676 Lines: 21 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/