lkml.org 
[lkml]   [2008]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] nommu: Correct kobjsize() page validity checks.
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.


\
 
 \ /
  Last update: 2008-06-12 17:49    [W:0.033 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site