lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 26 Aug 2011 11:00:16 +0200
From:	Tejun Heo <>
To:	Anton Blanchard <>
Subject: Re: [PATCH 2/2] percpu_counter: Put a reasonable upper bound on

On Fri, Aug 26, 2011 at 07:29:27AM +1000, Anton Blanchard wrote:
> When testing on a 1024 thread ppc64 box I noticed a large amount of
> CPU time in ext4 code.
> ext4_has_free_blocks has a fast path to avoid summing every free and
> dirty block per cpu counter, but only if the global count shows more
> free blocks than the maximum amount that could be stored in all the
> per cpu counters.
> Since percpu_counter_batch scales with num_online_cpus() and the maximum
> amount in all per cpu counters is percpu_counter_batch * num_online_cpus(),
> this breakpoint grows at O(n^2).
> This issue will also hit with users of percpu_counter_compare which
> does a similar thing for one percpu counter.
> I chose to cap percpu_counter_batch at 1024 as a conservative first
> step, but we may want to reduce it further based on further benchmarking.
> Signed-off-by: Anton Blanchard <>

Yeah, capping the upper bound seems reasonable but can you please add
some comment explaining why the upper bound is necessary there?

Thank you.

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists