From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 3/5] writeback: fix dirtied pages accounting on sub-page writes Date: Tue, 22 Nov 2011 13:57:42 +0100 Message-ID: <1321966662.5148.35.camel@twins> References: <20111121130342.211953629@intel.com> <20111121131215.905222115@intel.com> <20111122001127.GG4017@quack.suse.cz> <20111122092110.GB12864@localhost> <20111122122157.GB8058@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: Wu Fengguang , "linux-fsdevel@vger.kernel.org" , Christoph Hellwig , Andrew Morton , LKML To: Jan Kara Return-path: In-Reply-To: <20111122122157.GB8058@quack.suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2011-11-22 at 13:21 +0100, Jan Kara wrote: > > + __get_cpu_var(bdp_ratelimits)++; > I think you need preempt_disable() and preempt_enable() pair around > __get_cpu_var(). Otherwise a process could get rescheduled in the middle of > read-modify-write cycle... there's of course the this_cpu_inc(bdp_ratelimits); thing. On x86 that'll turn into a single insn, on others it will add the required preempt_disable/enable bits.