public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <clameter@sgi.com>,
	linux-kernel@vger.kernel.org, Paul Mundt <lethal@linux-sh.org>
Subject: Re: [RFC] Slab allocators: Drop support for destructors
Date: Thu, 10 May 2007 12:58:40 -0700	[thread overview]
Message-ID: <20070510195840.GN19966@holomorphy.com> (raw)
In-Reply-To: <84144f020705101221y6070ed93he837c59053084fae@mail.gmail.com>

On 5/10/07, Christoph Lameter <clameter@sgi.com> wrote:
>> Or are there valid reason to keep them around? It seems they were mainly
>> used for list management which required them to take a spinlock. Taking a
>> spinlock in a destructor is a bit risky since the slab allocators may run
>> the destructors anytime they decide a slab is no longer needed.
>> Or do we want to continue support destructors? If so why?

On Thu, May 10, 2007 at 10:21:08PM +0300, Pekka Enberg wrote:
> Well, constructors are on their way out too because they don't seem to
> give the performance benefit they were designed for anymore. As for
> destructors, they have been pretty useless in Linux for a long time
> now and we really don't do much "complex initialization" that requires
> undo (releasing resources).

The anti-constructor trend is counterproductive. The cache effects are
not being properly monitored and people are failing to understand the
importance of conserving cache.

Microbenchmarks where you pound the potentially preconstructed data
structures like wild monkeys are not why constructors are used. They're
to avoid burning cachelines in the cases where you need the cache for
other purposes besides building up and tearing down the structures in
question. Data structure layout becomes relevant to this; the
preconstructed cachelines need to be separated from ones that must be
clobbered regardless immediately after allocation. The effect is
cumulative and broadly dispersed. The constructor elimination patches
are incrementally filling up caches with the formerly preconstructed
objects' cachelines, where the degradation from each individual change
is so small as to be difficult to to discern or potentially even seen
to be advantageous on unrealistic microbenchmarks. The net effect of
removing constructors altogether will be degradations in real-world
workloads on account of the combined effect of the cache footprint
increases. The cache should rather be saved for userspace.

What would make this easier to see would be cache instrumentation not
available to most people. Specifically, tabulating what the various
cachelines in the cache are caching. Simulators may be useful to help
determine all that.


-- wli

  parent reply	other threads:[~2007-05-10 19:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 19:00 [RFC] Slab allocators: Drop support for destructors Christoph Lameter
2007-05-10 19:21 ` Pekka Enberg
2007-05-10 19:24   ` Christoph Lameter
2007-05-10 19:58   ` William Lee Irwin III [this message]
2007-05-10 19:22 ` William Lee Irwin III
2007-05-10 23:35 ` Paul Mundt
2007-05-11  2:21   ` Paul Mundt

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=20070510195840.GN19966@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=clameter@sgi.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    /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