mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Anton Blanchard <anton@samba.org>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca, tj@kernel.org,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] percpu_counter: Put a reasonable upper bound on percpu_counter_batch
Date: Fri, 26 Aug 2011 10:39:43 +0200	[thread overview]
Message-ID: <1314347983.2563.1.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <20110826072927.5b4781f9@kryten>

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);




  reply	other threads:[~2011-08-26  8:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 21:26 [PATCH 1/2] ext4: EXT4_FREEBLOCKS_WATERMARK is overly pessimistic Anton Blanchard
2011-08-25 21:29 ` [PATCH 2/2] percpu_counter: Put a reasonable upper bound on percpu_counter_batch Anton Blanchard
2011-08-26  8:39   ` Eric Dumazet [this message]
2011-08-29 11:46     ` [PATCH] " Anton Blanchard
2011-09-06  3:48       ` Tejun Heo
2011-09-06 13:30         ` Theodore Tso
2011-09-06 16:44           ` Tejun Heo
2011-09-07 11:08           ` Anton Blanchard
2011-08-26  9:00   ` [PATCH 2/2] " Tejun Heo
2011-08-26 11:48   ` Theodore Tso
2011-08-29 11:54     ` Anton Blanchard
2011-08-29 13:27     ` Ted Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314347983.2563.1.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
    --to=eric.dumazet@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=anton@samba.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®