From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: fix text reporting in O(1) proc_pid_statm()
Date: Tue, 24 Aug 2004 10:05:47 -0700 [thread overview]
Message-ID: <20040824170547.GP2793@holomorphy.com> (raw)
In-Reply-To: <20040824075539.GA2793@holomorphy.com>
On Tue, Aug 24, 2004 at 12:55:39AM -0700, William Lee Irwin III wrote:
> Merely removing down_read(&mm->mmap_sem) from task_vsize() is too
> half-assed to let stand. The following patch removes the vma iteration
> as well as the down_read(&mm->mmap_sem) from both task_mem() and
> task_statm() and callers for the CONFIG_MMU=y case in favor of
> accounting the various stats reported at the times of vma creation,
> destruction, and modification. Unlike the 2.4.x patches of the same
> name, this has no per-pte-modification overhead whatsoever.
> This patch quashes end user complaints of top(1) being slow as well as
> kernel hacker complaints of per-pte accounting overhead simultaneously.
> Incremental atop the task_vsize() de-mmap_sem-ification of 2.6.8.1-mm4:
Some kind of brainfart happened here, though it's not visible on the
default display from top(1) etc. This patch fixes up the gibberish I
mistakenly put down for text with the proper text size, and subtracts
it from data as per the O(vmas) code beforehand.
Index: mm4-2.6.8.1/fs/proc/task_mmu.c
===================================================================
--- mm4-2.6.8.1.orig/fs/proc/task_mmu.c 2004-08-23 18:29:33.000000000 -0700
+++ mm4-2.6.8.1/fs/proc/task_mmu.c 2004-08-24 10:00:21.530755896 -0700
@@ -36,8 +36,8 @@
int *data, int *resident)
{
*shared = mm->shared_vm;
- *text = mm->exec_vm - ((mm->end_code - mm->start_code) >> PAGE_SHIFT);
- *data = mm->total_vm - mm->shared_vm;
+ *text = (mm->end_code - mm->start_code) >> PAGE_SHIFT;
+ *data = mm->total_vm - mm->shared_vm - *text;
*resident = mm->rss;
return mm->total_vm;
}
next prev parent reply other threads:[~2004-08-24 17:05 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-22 8:34 2.6.8.1-mm4 Andrew Morton
2004-08-22 14:20 ` 2.6.8.1-mm4 (strange behavior on dual Opteron w/ NUMA) R. J. Wysocki
2004-08-23 15:29 ` David Howells
2004-08-23 15:46 ` Randy.Dunlap
2004-08-23 18:27 ` Andrew Morton
2004-08-23 18:57 ` Randy.Dunlap
2004-08-23 2:18 ` 2.6.8.1-mm4 - failed opcode was: 0xe7 Ed Tomlinson
2004-08-23 5:00 ` 2.6.8.1-mm4 Eric W. Biederman
2004-08-23 12:00 ` 2.6.8.1-mm4 Alan Cox
2004-08-23 14:24 ` 2.6.8.1-mm4 Eric W. Biederman
2004-08-23 14:11 ` 2.6.8.1-mm4 (compile stats) John Cherry
2004-08-23 18:21 ` 2.6.8.1-mm4 Tomasz Torcz
2004-08-23 18:31 ` 2.6.8.1-mm4 Alan Cox
2004-08-23 19:40 ` 2.6.8.1-mm4 Andrew Morton
2004-08-23 19:15 ` 2.6.8.1-mm4 Alan Cox
2004-08-23 21:19 ` 2.6.8.1-mm4 David S. Miller
2004-08-23 20:21 ` 2.6.8.1-mm4 wli
2004-08-24 6:14 ` 2.6.8.1-mm4 Andrew Morton
2004-08-24 7:55 ` O(1) proc_pid_statm() William Lee Irwin III
2004-08-24 17:05 ` William Lee Irwin III [this message]
2004-08-25 0:06 ` [PATCH] advice to use good patch subject, for SubmittingPatches Tim Bird
2004-08-23 22:18 ` 2.6.8.1-mm4 - more cpu hotplug breakage Nathan Lynch
2004-08-25 3:57 ` Nathan Lynch
2004-08-25 23:09 ` Nathan Lynch
2004-08-26 2:54 ` Rusty Russell
2004-08-26 7:57 ` [PATCH 1/2] Neaten migrate_all_tasks Rusty Russell
2004-08-26 7:58 ` [PATCH 2/2] Hotplug CPU vs TASK_ZOMBIEs: The Sequel to Hotplug CPU vs TASK_DEAD Rusty Russell
2004-08-26 15:29 ` Nathan Lynch
2004-08-27 1:38 ` Rusty Russell
2004-08-24 20:56 ` 2.6.8.1-mm4 William Lee Irwin III
2004-08-24 20:57 ` 2.6.8.1-mm4 William Lee Irwin III
2004-08-24 21:23 ` 2.6.8.1-mm4 William Lee Irwin III
2004-08-24 21:26 ` 2.6.8.1-mm4 William Lee Irwin III
2004-08-24 21:37 ` 2.6.8.1-mm4 William Lee Irwin III
2004-08-24 21:48 ` 2.6.8.1-mm4 William Lee Irwin III
2004-08-24 21:06 ` WAITQUEUE_DEBUG crapectomy William Lee Irwin III
-- strict thread matches above, loose matches on Subject: below --
2004-08-24 23:06 fix text reporting in O(1) proc_pid_statm() Albert Cahalan
2004-08-24 23:12 ` William Lee Irwin III
2004-08-24 23:18 ` William Lee Irwin III
2004-08-24 23:24 ` William Lee Irwin III
2004-08-25 0:01 ` William Lee Irwin III
2004-08-25 2:52 ` Albert Cahalan
2004-08-25 3:04 ` 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=20040824170547.GP2793@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@osdl.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.