From: Tim Chen Date: Tue, 10 Aug 2010 00:19:04 +0000 (-0700) Subject: tmpfs: add accurate compare function to percpu_counter library X-Git-Tag: v2.6.36-rc1~440 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27f5e0f694fd0600274a76854636c0749e3bb1f6;p=pandora-kernel.git tmpfs: add accurate compare function to percpu_counter library Add percpu_counter_compare that allows for a quick but accurate comparison of percpu_counter with a given value. A rough count is provided by the count field in percpu_counter structure, without accounting for the other values stored in individual cpu counters. The actual count is a sum of count and the cpu counters. However, count field is never different from the actual value by a factor of batch*num_online_cpu. We do not need to get actual count for comparison if count is different from the given value by this factor and allows for quick comparison without summing up all the per cpu counters. Signed-off-by: Tim Chen Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed