[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1314347983.2563.1.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date: Fri, 26 Aug 2011 10:39:43 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Anton Blanchard <anton@...ba.org>
Cc: tytso@....edu, adilger.kernel@...ger.ca, tj@...nel.org,
linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] percpu_counter: Put a reasonable upper bound on
percpu_counter_batch
Le vendredi 26 août 2011 à 07:29 +1000, Anton Blanchard a écrit :
> +/*
> + * We set the batch at 2 * num_online_cpus(), with a minimum of 32 and
> + * a maximum of 1024.
> + */
> static void compute_batch_value(void)
> {
> int nr = num_online_cpus();
>
> - percpu_counter_batch = max(32, nr*2);
> + percpu_counter_batch = min(1024, max(32, nr*2));
> }
>
> static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb,
Or use the following :
percpu_counter_batch = clamp(nr*2, 32, 1024);
--
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