[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150514150230.GF11388@htj.duckdns.org>
Date: Thu, 14 May 2015 11:02:30 -0400
From: Tejun Heo <tj@...nel.org>
To: Dave Chinner <david@...morbit.com>
Cc: xfs@....sgi.com, linux-kernel@...r.kernel.org, peterz@...radead.org
Subject: Re: [PATCH 1/2] percpu_counter: batch size aware
__percpu_counter_compare()
On Thu, May 14, 2015 at 10:55:53AM +1000, Dave Chinner wrote:
> percpu_counter: batch size aware __percpu_counter_compare()
>
> From: Dave Chinner <dchinner@...hat.com>
>
> XFS uses non-stanard batch sizes for avoiding frequent global
> counter updates on it's allocated inode counters, as they increment
> or decrement in batches of 64 inodes. Hence the standard percpu
> counter batch of 32 means that the counter is effectively a global
> counter. Currently Xfs uses a batch size of 128 so that it doesn't
> take the global lock on every single modification.
>
> However, Xfs also needs to compare accurately against zero, which
> means we need to use percpu_counter_compare(), and that has a
> hard-coded batch size of 32, and hence will spuriously fail to
> detect when it is supposed to use precise comparisons and hence
> the accounting goes wrong.
>
> Add __percpu_counter_compare() to take a custom batch size so we can
> use it sanely in XFS and factor percpu_counter_compare() to use it.
>
> Signed-off-by: Dave Chinner <dchinner@...hat.com>
Acked-by: Tejun Heo <tj@...nel.org>
Please feel free to route the patch however you see fit.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists