public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Paul Mundt <lethal@linux-sh.org>
Cc: dhowells@redhat.com,
	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: Thu, 12 Jun 2008 11:20:53 +0100	[thread overview]
Message-ID: <2336.1213266053@redhat.com> (raw)
In-Reply-To: <27332.1213264136@redhat.com>

David Howells <dhowells@redhat.com> wrote:

> Works for me.

Having said that, it doesn't produce the right answers under SLOB, with or
without this patch:

	void task_mem(struct seq_file *m, struct mm_struct *mm)
	{
		struct vm_list_struct *vml;
		unsigned long bytes = 0, sbytes = 0, slack = 0;

		down_read(&mm->mmap_sem);
		for (vml = mm->context.vmlist; vml; vml = vml->next) {
			if (!vml->vma)
				continue;

			bytes += kobjsize(vml);

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.


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.

David

  reply	other threads:[~2008-06-12 10:21 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 [this message]
2008-06-12 15:43     ` 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=2336.1213266053@redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=cooloney@kernel.org \
    --cc=lethal@linux-sh.org \
    --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