public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* per-process shared information
@ 2004-10-13 23:10 Andrea Arcangeli
  2004-10-14 21:47 ` Marcelo Tosatti
  2004-10-14 21:49 ` Hugh Dickins
  0 siblings, 2 replies; 35+ messages in thread
From: Andrea Arcangeli @ 2004-10-13 23:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hugh Dickins, Andrew Morton

The 2.6 kernel dropped the shared information for each task, the third
field in /proc/<pid>/statem is a fake largely overstimating the number
of shared pages (it gets even bigger than the rss, that's why people
noticed, because the shared information was even bigger than the rss of
the task, so clearly those pages couldn't be shared if they didn't
exist).

Nothing important goes wrong in practice, but some statistics gets
screwed (gets underflows since they're rightfully used to compute rss -
shared to find the "private" not shared anonymous data).

I guess I can simply resurrect the O(N) pagetable scanning and check for
page_mapcount > 1 out of order in task_mmu.c? I want to add a new file
"statm_phys_shared" instead of doing it in statm, to avoid slowing down
ps xav. So special apps can still get the information out of the kernel.

At first I considered providing the "shared" information in O(log(N))
but I believe it would waste quite some cpu in the fast paths (it would
require walking the prio trees or the anon-vmas in each page fault, and
it would need to keep track of each vma->mm that we already updated
during the prio-tree walking), so I'd prefer the statistics to be slow
in O(N) instead of hurting the fast paths. If I allow rescheduling and I
trap signals there should be no DoS involved even in the very huge
boxes.

Comments? (can you suggest a better name?)

Ps. if somebody like Hugh volunteers implementing it, you're very
welcome, just let me know (I'll eventually want to work on the oom
handling too, which is pretty screwed right now, I've plenty of bugs
open on that area and the lowmem zone protection needs a rewrite too to
be set to a sane default value no matter the pages_lows etc..).

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2004-10-19 15:16 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-13 23:10 per-process shared information Andrea Arcangeli
2004-10-14 21:47 ` Marcelo Tosatti
2004-10-14 23:58   ` Andrea Arcangeli
2004-10-14 23:17     ` Marcelo Tosatti
2004-10-15 10:45     ` William Lee Irwin III
2004-10-14 21:49 ` Hugh Dickins
2004-10-14 22:11   ` William Lee Irwin III
2004-10-14 22:37   ` Andrea Arcangeli
2004-10-15 10:51     ` William Lee Irwin III
2004-10-15 11:56     ` Hugh Dickins
2004-10-15 13:19       ` Albert Cahalan
2004-10-15 14:28         ` William Lee Irwin III
2004-10-15 14:40           ` Albert Cahalan
2004-10-15 14:52             ` William Lee Irwin III
2004-10-15 17:02             ` Andrea Arcangeli
2004-10-15 16:20         ` Andrea Arcangeli
2004-10-15 16:31           ` Albert Cahalan
2004-10-15 17:10             ` William Lee Irwin III
2004-10-15 19:29               ` Albert Cahalan
2004-10-15 17:13             ` Andrea Arcangeli
2004-10-15 17:51               ` Albert Cahalan
2004-10-15 18:14                 ` Andrea Arcangeli
2004-10-15 18:30                   ` William Lee Irwin III
2004-10-15 18:40                     ` Andrea Arcangeli
2004-10-15 18:47                       ` William Lee Irwin III
2004-10-15 19:23                         ` Andrea Arcangeli
2004-10-15 20:41                           ` William Lee Irwin III
2004-10-15 20:52                             ` Andrea Arcangeli
2004-10-15 21:16                         ` William Lee Irwin III
2004-10-15 21:28                           ` Andrea Arcangeli
2004-10-15 21:40                             ` William Lee Irwin III
2004-10-15 22:04                               ` Hugh Dickins
2004-10-19 15:09           ` Bill Davidsen
2004-10-15 16:04       ` Andrea Arcangeli
2004-10-19 15:18         ` Bill Davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox