public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bryan Wu <bryan.wu@analog.com>
To: linux-kernel@vger.kernel.org
Cc: Bernd Schmidt <bernd.schmidt@analog.com>, Bryan Wu <bryan.wu@analog.com>
Subject: [PATCH 1/1] [NOMMU]: Dont use kobjsize on the area belonging to a VMA
Date: Wed, 30 Jan 2008 18:25:08 +0800	[thread overview]
Message-ID: <1201688708-2152-1-git-send-email-bryan.wu@analog.com> (raw)

From: Bernd Schmidt <bernd.schmidt@analog.com>

Dont use kobjsize on the area belonging to a VMA, as it's allocated with
get_free_pages.

Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
---
 fs/proc/task_nommu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index 1932c2c..1d0513e 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -76,7 +76,7 @@ unsigned long task_vsize(struct mm_struct *mm)
 	down_read(&mm->mmap_sem);
 	for (tbp = mm->context.vmlist; tbp; tbp = tbp->next) {
 		if (tbp->vma)
-			vsize += kobjsize((void *) tbp->vma->vm_start);
+			vsize += tbp->vma->vm_end - tbp->vma->vm_start;
 	}
 	up_read(&mm->mmap_sem);
 	return vsize;
@@ -93,7 +93,7 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
 		size += kobjsize(tbp);
 		if (tbp->vma) {
 			size += kobjsize(tbp->vma);
-			size += kobjsize((void *) tbp->vma->vm_start);
+			size += tbp->vma->vm_end - tbp->vma->vm_start;
 		}
 	}
 
-- 
1.5.3.4

             reply	other threads:[~2008-01-30 10:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 10:25 Bryan Wu [this message]
2008-01-30 13:04 ` [PATCH 1/1] [NOMMU]: Dont use kobjsize on the area belonging to a VMA Bernd Schmidt
2008-01-30 17:03   ` Bryan Wu
2008-01-30 22:47     ` Bernd Schmidt

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=1201688708-2152-1-git-send-email-bryan.wu@analog.com \
    --to=bryan.wu@analog.com \
    --cc=bernd.schmidt@analog.com \
    --cc=linux-kernel@vger.kernel.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