public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: David Howells <dhowells@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Lameter <clameter@sgi.com>,
	Bryan Wu <cooloney@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nommu: Correct kobjsize() page validity checks.
Date: Fri, 13 Jun 2008 00:43:59 +0900	[thread overview]
Message-ID: <20080612154359.GA9327@linux-sh.org> (raw)
In-Reply-To: <2336.1213266053@redhat.com>

On Thu, Jun 12, 2008 at 11:20:53AM +0100, David Howells wrote:
> Here kobjsize() returns 16384 (PAGE_SIZE) when it should return something a
> lot smaller.  This appears related to SLOB not setting PG_slab, so
> /proc/pic/status gets messed up:
> 
> 	Mem:      983040 bytes
> 	Slack:     44112 bytes
> 	Shared:  1687552 bytes
> 
> SLAB returns 64 at this point, and in /proc/pid/status shows:
> 
> 	Mem:      594016 bytes
> 	Slack:     44112 bytes
> 	Shared:  1638688 bytes
> 
> with or without the patch, which might even be correct.
> 
Yes, this is the fundamental problem with kobjsize() as it is today.
Without the setting of PG_slab, non-compound page objects default to
PAGE_SIZE. Pekka posted a series of patches that hooked PG_slab in to
SLUB and SLOB that get the same degree of accuracy that SLAB has today,
but there was opposition to merging those.

> Maybe on SLOB we want kobjsize() to become sizeof() where we're dealing with
> fixed size units such as structs.  On the other hand, getting rid of
> kobjsize() entirely would be good.
> 
I think for the time being we have to live with the innacuracy, and
simply focus on getting rid of kobjsize() entirely. Without additional
help from the various allocators, there's really not that much we can do.
Rather than papering over that, bringing nommu more in line with MMU
semantics is certainly a preferable option.

This patch in particular is unrelated to the inaccuracy issues, although
it should fix the cases where kobjsize() would mistakenly account
reserved pages.

      reply	other threads:[~2008-06-12 15:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12  7:29 [PATCH] nommu: Correct kobjsize() page validity checks Paul Mundt
2008-06-12  9:48 ` David Howells
2008-06-12 10:20   ` David Howells
2008-06-12 15:43     ` Paul Mundt [this message]

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=20080612154359.GA9327@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=cooloney@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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