From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH] percpu_counter : add percpu_counter_add_fast() Date: Thu, 21 Oct 2010 15:43:33 -0700 Message-ID: <20101021154333.f67fd870.akpm@linux-foundation.org> References: <1285762729-17928-1-git-send-email-david@fromorbit.com> <1285762729-17928-17-git-send-email-david@fromorbit.com> <20100929215322.ff635d3e.akpm@linux-foundation.org> <20100930061039.GX5665@dastard> <20101016075510.GH19147@amd> <1287217748.2799.68.camel@edumazet-laptop> <20101016020744.366bd9c6.akpm@linux-foundation.org> <1287221475.2799.123.camel@edumazet-laptop> <1287238754.2799.376.camel@edumazet-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Nick Piggin , Dave Chinner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Lameter To: Eric Dumazet Return-path: In-Reply-To: <1287238754.2799.376.camel@edumazet-laptop> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sat, 16 Oct 2010 16:19:14 +0200 Eric Dumazet wrote: > The current way to change a percpu_counter is to call > percpu_counter_add(), which is a bit expensive. > (More than 40 instructions, possible false sharing, ...) This is incorrect. With my compiler it's 25 instructions except in the very rare case where a batch overflow occurs. And more than half of that is function call entry/exit overhead.