public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Aubrey <aubreylee@gmail.com>
Cc: "David Howells" <dhowells@redhat.com>,
	linux-kernel@vger.kernel.org, mpm@selenic.com,
	davidm@snapgear.com, gerg@snapgear.com
Subject: Re: kernel BUGs when removing largish files with the SLOB allocator
Date: Tue, 05 Sep 2006 10:35:03 +0100	[thread overview]
Message-ID: <3551.1157448903@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <6d6a94c50609042052n4c1803eey4f4412f6153c4a2b@mail.gmail.com>

Aubrey <aubreylee@gmail.com> wrote:

> IMHO the problem is nommu.c is written for slab only. So when slob is
> enabled, it need to be considered to make some modification to make
> two or more memory allocator algorithms work properly, rather than to
> force all others algorithm to be compatible with the current one(slab)
> to match the code in the nommu.c, which is not common enough.
>
> Does that make sense?

No, not really.

The point is that kobjsize() needs to determine the size of the object it has
been asked to assess.  It knows how to do that directly if the page is
allocated by the main page allocator, but not if the page belongs to the slab
allocator.  The quickest way it can determine this is to look at PG_slab.  In
such a case it defers to the slab allocator for a determination.

What I don't want to happen is that we have to defer immediately to the slob
allocator which then goes and searches various lists to see if it owns the
page.  Remember: unless the page is _marked_ as belonging to the slob
allocator, the slob allocator may _not_ assume any of the metadata in struct
page is valid slob metadata.  It _has_ to determine the validity of the page
by other means _before_ it can use the metadata, and that most likely means a
search.  This is why PG_slab exists: if it is set, you _know_ you can
instantly trust the metadata.

Since slob appears to be an entry-point-by-entry-point replacement for the
slab allocator, the slob allocator can also mark its pages for anything that's
looking to defer to it using PG_slab since the presence of slab and slob are
mutually exclusive.

Also, we already have two major memory allocator algorithms in the kernel at
any one time: (1) the main page allocator and (2) slab or slob.  We don't
really want to start going to three or more.


So, I come back to the main question: Why don't you want to use PG_slab?

David

  reply	other threads:[~2006-09-05  9:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-04  6:56 kernel BUGs when removing largish files with the SLOB allocator Aubrey
2006-09-04 10:21 ` David Howells
2006-09-05  3:52   ` Aubrey
2006-09-05  9:35     ` David Howells [this message]
2006-09-06  2:35       ` Aubrey
2006-09-06  3:36         ` Nick Piggin
2006-09-12  8:07           ` Aubrey
2006-09-12  8:54             ` David Howells
2006-09-12 10:53               ` Aubrey
2006-09-12 17:43             ` Matt Mackall
2006-09-12 19:10               ` David Howells
2006-09-12 20:51                 ` Matt Mackall
2006-09-12 20:56                   ` David Howells
2006-09-12 21:04                     ` Matt Mackall
2006-09-12 21:59                       ` David Howells
2006-09-13 19:39                         ` Matt Mackall
2006-09-13  2:16                 ` Nick Piggin
2006-09-13  7:21                   ` Aubrey
2006-09-12 19:25               ` David Howells
2006-09-12 20:28                 ` Matt Mackall
2006-09-12 21:02                   ` David Howells
2006-09-12 21:15                     ` Matt Mackall
2006-09-12 20:49                 ` Matt Mackall

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=3551.1157448903@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=aubreylee@gmail.com \
    --cc=davidm@snapgear.com \
    --cc=gerg@snapgear.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /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