mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] percpu_counter: increase batch count
@ 2021-02-18 21:36 Jens Axboe
  2021-02-18 23:16 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2021-02-18 21:36 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Currently we cap the batch count at max(32, 2*nr_online_cpus), which these
days is kind of silly as systems have gotten much bigger than in 2009 when
this heuristic was introduced.

Bump it to capping it at 256 instead. This has a noticeable improvement
for certain io_uring workloads, as io_uring tracks per-task inflight count
using percpu counters.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index 00f666d94486..c3a9af5462ba 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -188,7 +188,7 @@ static int compute_batch_value(unsigned int cpu)
 {
 	int nr = num_online_cpus();
 
-	percpu_counter_batch = max(32, nr*2);
+	percpu_counter_batch = max(256, nr*2);
 	return 0;
 }
 

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-22 22:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 21:36 [PATCH] percpu_counter: increase batch count Jens Axboe
2021-02-18 23:16 ` Andrew Morton
2021-02-18 23:23   ` Jens Axboe
2021-02-22 21:31     ` Hugh Dickins
2021-02-22 21:53       ` Jens Axboe
2021-02-22 22:14         ` Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome