diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2016-02-02 19:57:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-03 11:28:43 -0500 |
commit | 65376df582174ffcec9e6471bf5b0dd79ba05e4a (patch) | |
tree | 60c4841a00605605bf8c315783ed48648333e865 /Documentation/filesystems | |
parent | 5c2ff95e41c9290d16556cd02e35b25d81be8fe0 (diff) |
proc: revert /proc/<pid>/maps [stack:TID] annotation
Commit b76437579d13 ("procfs: mark thread stack correctly in
proc/<pid>/maps") added [stack:TID] annotation to /proc/<pid>/maps.
Finding the task of a stack VMA requires walking the entire thread list,
turning this into quadratic behavior: a thousand threads means a
thousand stacks, so the rendering of /proc/<pid>/maps needs to look at a
million combinations.
The cost is not in proportion to the usefulness as described in the
patch.
Drop the [stack:TID] annotation to make /proc/<pid>/maps (and
/proc/<pid>/numa_maps) usable again for higher thread counts.
The [stack] annotation inside /proc/<pid>/task/<tid>/maps is retained, as
identifying the stack VMA there is an O(1) operation.
Siddesh said:
"The end users needed a way to identify thread stacks programmatically and
there wasn't a way to do that. I'm afraid I no longer remember (or have
access to the resources that would aid my memory since I changed
employers) the details of their requirement. However, I did do this on my
own time because I thought it was an interesting project for me and nobody
really gave any feedback then as to its utility, so as far as I am
concerned you could roll back the main thread maps information since the
information is available in the thread-specific files"
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Cc: Shaohua Li <shli@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/proc.txt | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index fde9fd06fa98..eaebf27539f5 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -356,7 +356,7 @@ address perms offset dev inode pathname | |||
356 | a7cb1000-a7cb2000 ---p 00000000 00:00 0 | 356 | a7cb1000-a7cb2000 ---p 00000000 00:00 0 |
357 | a7cb2000-a7eb2000 rw-p 00000000 00:00 0 | 357 | a7cb2000-a7eb2000 rw-p 00000000 00:00 0 |
358 | a7eb2000-a7eb3000 ---p 00000000 00:00 0 | 358 | a7eb2000-a7eb3000 ---p 00000000 00:00 0 |
359 | a7eb3000-a7ed5000 rw-p 00000000 00:00 0 [stack:1001] | 359 | a7eb3000-a7ed5000 rw-p 00000000 00:00 0 |
360 | a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6 | 360 | a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6 |
361 | a8008000-a800a000 r--p 00133000 03:00 4222 /lib/libc.so.6 | 361 | a8008000-a800a000 r--p 00133000 03:00 4222 /lib/libc.so.6 |
362 | a800a000-a800b000 rw-p 00135000 03:00 4222 /lib/libc.so.6 | 362 | a800a000-a800b000 rw-p 00135000 03:00 4222 /lib/libc.so.6 |
@@ -388,7 +388,6 @@ is not associated with a file: | |||
388 | 388 | ||
389 | [heap] = the heap of the program | 389 | [heap] = the heap of the program |
390 | [stack] = the stack of the main process | 390 | [stack] = the stack of the main process |
391 | [stack:1001] = the stack of the thread with tid 1001 | ||
392 | [vdso] = the "virtual dynamic shared object", | 391 | [vdso] = the "virtual dynamic shared object", |
393 | the kernel system call handler | 392 | the kernel system call handler |
394 | 393 | ||
@@ -396,10 +395,8 @@ is not associated with a file: | |||
396 | 395 | ||
397 | The /proc/PID/task/TID/maps is a view of the virtual memory from the viewpoint | 396 | The /proc/PID/task/TID/maps is a view of the virtual memory from the viewpoint |
398 | of the individual tasks of a process. In this file you will see a mapping marked | 397 | of the individual tasks of a process. In this file you will see a mapping marked |
399 | as [stack] if that task sees it as a stack. This is a key difference from the | 398 | as [stack] if that task sees it as a stack. Hence, for the example above, the |
400 | content of /proc/PID/maps, where you will see all mappings that are being used | 399 | task-level map, i.e. /proc/PID/task/TID/maps for thread 1001 will look like this: |
401 | as stack by all of those tasks. Hence, for the example above, the task-level | ||
402 | map, i.e. /proc/PID/task/TID/maps for thread 1001 will look like this: | ||
403 | 400 | ||
404 | 08048000-08049000 r-xp 00000000 03:00 8312 /opt/test | 401 | 08048000-08049000 r-xp 00000000 03:00 8312 /opt/test |
405 | 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test | 402 | 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test |