linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roger Luethi <rl@hellgate.ch>
To: William Lee Irwin III <wli@holomorphy.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] Deprecate /proc/#/statm
Date: Wed, 13 Aug 2003 09:58:14 +0200	[thread overview]
Message-ID: <20030813075814.GA6182@k3.hellgate.ch> (raw)
In-Reply-To: <20030813003620.GG3170@holomorphy.com>

On Tue, 12 Aug 2003 17:36:20 -0700, William Lee Irwin III wrote:
> Best to just delete the code instead of the #if 0

Like this?

Roger

diff -ur linux-2.5.orig/fs/proc/array.c linux-2.5/fs/proc/array.c
--- linux-2.5.orig/fs/proc/array.c	2003-08-13 09:50:15.485989476 +0200
+++ linux-2.5/fs/proc/array.c	2003-08-13 09:45:03.646004248 +0200
@@ -388,19 +388,10 @@
 	return res;
 }
 
-extern int task_statm(struct mm_struct *, int *, int *, int *, int *);
 int proc_pid_statm(struct task_struct *task, char *buffer)
 {
 	int size = 0, resident = 0, shared = 0, text = 0, lib = 0, data = 0;
-	struct mm_struct *mm = get_task_mm(task);
-	
-	if (mm) {
-		down_read(&mm->mmap_sem);
-		size = task_statm(mm, &shared, &text, &data, &resident);
-		up_read(&mm->mmap_sem);
-
-		mmput(mm);
-	}
+	/* TODO Rip /proc/#/statm out in 2.7 */
 
 	return sprintf(buffer,"%d %d %d %d %d %d %d\n",
 		       size, resident, shared, text, lib, data, 0);
diff -ur linux-2.5.orig/fs/proc/task_mmu.c linux-2.5/fs/proc/task_mmu.c
--- linux-2.5.orig/fs/proc/task_mmu.c	2003-08-13 09:45:57.507057766 +0200
+++ linux-2.5/fs/proc/task_mmu.c	2003-08-13 09:41:41.844772701 +0200
@@ -48,33 +48,6 @@
 	return PAGE_SIZE * mm->total_vm;
 }
 
-int task_statm(struct mm_struct *mm, int *shared, int *text,
-	       int *data, int *resident)
-{
-	struct vm_area_struct *vma;
-	int size = 0;
-
-	*resident = mm->rss;
-	for (vma = mm->mmap; vma; vma = vma->vm_next) {
-		int pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
-
-		size += pages;
-		if (is_vm_hugetlb_page(vma)) {
-			if (!(vma->vm_flags & VM_DONTCOPY))
-				*shared += pages;
-			continue;
-		}
-		if (vma->vm_flags & VM_SHARED || !list_empty(&vma->shared))
-			*shared += pages;
-		if (vma->vm_flags & VM_EXECUTABLE)
-			*text += pages;
-		else
-			*data += pages;
-	}
-
-	return size;
-}
-
 static int show_map(struct seq_file *m, void *v)
 {
 	struct vm_area_struct *map = v;
diff -ur linux-2.5.orig/fs/proc/task_nommu.c linux-2.5/fs/proc/task_nommu.c
--- linux-2.5.orig/fs/proc/task_nommu.c	2003-08-13 09:45:57.509057471 +0200
+++ linux-2.5/fs/proc/task_nommu.c	2003-08-13 09:42:06.212178570 +0200
@@ -75,28 +75,6 @@
 	return vsize;
 }
 
-int task_statm(struct mm_struct *mm, int *shared, int *text,
-	       int *data, int *resident)
-{
-	struct mm_tblock_struct *tbp;
-	int size = kobjsize(mm);
-	
-	for (tbp = &mm->context.tblock; tbp; tbp = tbp->next) {
-		if (tbp->next)
-			size += kobjsize(tbp->next);
-		if (tbp->rblock) {
-			size += kobjsize(tbp->rblock);
-			size += kobjsize(tbp->rblock->kblock);
-		}
-	}
-
-	size += (*text = mm->end_code - mm->start_code);
-	size += (*data = mm->start_stack - mm->start_data);
-
-	*resident = size;
-	return size;
-}
-
 /*
  * Albert D. Cahalan suggested to fake entries for the traditional
  * sections here.  This might be worth investigating.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2003-08-13  7:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-11  9:02 Is /proc/#/statm worth fixing? Roger Luethi
2003-08-11 16:02 ` William Lee Irwin III
2003-08-11 21:52   ` Roger Luethi
2003-08-11 22:16     ` William Lee Irwin III
2003-08-12 10:40       ` [PATCH] Deprecate /proc/#/statm Roger Luethi
2003-08-13  0:36         ` William Lee Irwin III
2003-08-13  7:58           ` Roger Luethi [this message]
2003-08-14  6:40             ` William Lee Irwin III

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=20030813075814.GA6182@k3.hellgate.ch \
    --to=rl@hellgate.ch \
    --cc=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    --cc=wli@holomorphy.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