From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH] percpu_counter : add percpu_counter_add_fast() Date: Fri, 22 Oct 2010 06:12:05 +0200 Message-ID: <1287720725.7984.3.camel@edumazet-laptop> 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> <20101021153719.c8bde251.akpm@linux-foundation.org> <20101021174536.26213ab7.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Christoph Lameter , Nick Piggin , Dave Chinner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Andrew Morton Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:49889 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1749667Ab0JVEMQ (ORCPT ); Fri, 22 Oct 2010 00:12:16 -0400 In-Reply-To: <20101021174536.26213ab7.akpm@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Le jeudi 21 octobre 2010 =C3=A0 17:45 -0700, Andrew Morton a =C3=A9crit= : > this_cpu_add_return() isn't really needed in this application. >=20 > { > this_cpu_add(*fbc->counters, amount); > if (unlikely(abs(this_cpu_read(*fbc->counters)) > fbc->batch)) > out_of_line_stuff(); > }=09 >=20 > will work just fine. =09 Hmm, you cannot do this on 32bit machines because "amount" is 64bit wide. Switching counters to s64 is not an option (makes summation racy, and memory use bigger) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html