From: Christoph Lameter <clameter@sgi.com>
To: Arjan van de Ven <arjan@linux.intel.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel
Subject: Re: Please revert [PATCH] user of the jiffies rounding patch: Slab
Date: Sat, 28 Apr 2007 16:35:55 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0704281632001.12695@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <4633D1A2.6010002@linux.intel.com>
On Sat, 28 Apr 2007, Arjan van de Ven wrote:
> Christoph Lameter wrote:
> > The slab reaper takes global locks. If one makes all cache reapers fire at
> > the same time as this patch does then there will be a lot of contention that
> > may result lots of interrupt holdoffs since some locks are taken
> > with interrupts disabled. The vm statistics counters are updated
> > and will content for global cachelines if this is done.
>
> > I'd suggest to use a staggered per cpu approach instead that runs multiple
> > per cpu timers at once. But every batch of these timers must be run at an
> > offset from each other. Not at the same time please.
>
> from kernel/timer.c
>
> 107
> 108 /*
> 109 * We don't want all cpus firing their timers at once hitting the
> 110 * same lock or cachelines, so we skew each extra cpu with an
> extra
> 111 * 3 jiffies. This 3 jiffies came originally from the mm/ code
> which
> 112 * already did this.
> 113 * The skew is done by adding 3*cpunr, then round, then subtract
> this
> 114 * extra offset again.
> 115 */
> 116 j += cpu * 3;
>
>
> isn't 3 jiffies distance per cpu enough for this already ??
> That's what it used to be before as well...
Hmmm... Yes but that looks like it comes from a different function. Slab
calls
__round_jiffies_relative(HZ, cpu))
And its description says:
/**
* __round_jiffies_relative - function to round jiffies to a full second
* @j: the time in (relative) jiffies that should be rounded
* @cpu: the processor number on which the timeout will happen
*
* __round_jiffies_relative() rounds a time delta in the future (in jiffies)
* up or down to (approximately) full seconds. This is useful for timers
* for which the exact time they fire does not matter too much, as long as
* they fire approximately every X seconds.
*
* By rounding these timers to whole seconds, all such timers will fire
* at the same time, rather than at various times spread out. The goal
* of this is to have the CPU wake up less, which saves power.
*
* The exact rounding is skewed for each processor to avoid all
* processors firing at the exact same time, which could lead
* to lock contention or spurious cache line bouncing.
*
* The return value is the rounded version of the @j parameter.
*/
This is exactly the wrong thing to do.
next prev parent reply other threads:[~2007-04-28 23:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-28 21:12 Christoph Lameter
[not found] ` <4633D1A2.6010002@linux.intel.com>
2007-04-28 23:35 ` Christoph Lameter [this message]
2007-04-28 23:40 ` Arjan van de Ven
2007-04-30 17:43 ` Christoph Lameter
2007-04-30 19:14 ` Arjan van de Ven
2007-04-30 19:28 ` Christoph Lameter
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=Pine.LNX.4.64.0704281632001.12695@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@osdl.org \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel \
/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®