<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/proc, branch v3.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-06-04T18:00:45Z</updated>
<entry>
<title>vfs: Fix /proc/&lt;tid&gt;/fdinfo/&lt;fd&gt; file handling</title>
<updated>2012-06-04T18:00:45Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-06-04T18:00:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0640113be25d283e0ff77a9f041e1242182387f0'/>
<id>urn:sha1:0640113be25d283e0ff77a9f041e1242182387f0</id>
<content type='text'>
Cyrill Gorcunov reports that I broke the fdinfo files with commit
30a08bf2d31d ("proc: move fd symlink i_mode calculations into
tid_fd_revalidate()"), and he's quite right.

The tid_fd_revalidate() function is not just used for the &lt;tid&gt;/fd
symlinks, it's also used for the &lt;tid&gt;/fdinfo/&lt;fd&gt; files, and the
permission model for those are different.

So do the dynamic symlink permission handling just for symlinks, making
the fdinfo files once more appear as the proper regular files they are.

Of course, Al Viro argued (probably correctly) that we shouldn't do the
symlink permission games at all, and make the symlinks always just be
the normal 'lrwxrwxrwx'.  That would have avoided this issue too, but
since somebody noticed that the permissions had changed (which was the
reason for that original commit 30a08bf2d31d in the first place), people
do apparently use this feature.

[ Basically, you can use the symlink permission data as a cheap "fdinfo"
  replacement, since you see whether the file is open for reading and/or
  writing by just looking at st_mode of the symlink.  So the feature
  does make sense, even if the pain it has caused means we probably
  shouldn't have done it to begin with. ]

Reported-and-tested-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>c/r: procfs: add arg_start/end, env_start/end and exit_code members to /proc/$pid/stat</title>
<updated>2012-06-01T00:49:32Z</updated>
<author>
<name>Cyrill Gorcunov</name>
<email>gorcunov@openvz.org</email>
</author>
<published>2012-05-31T23:26:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5b172087f99189416d5f47fd7ab5e6fb762a9ba3'/>
<id>urn:sha1:5b172087f99189416d5f47fd7ab5e6fb762a9ba3</id>
<content type='text'>
We would like to have an ability to restore command line arguments and
program environment pointers but first we need to obtain them somehow.
Thus we put these values into /proc/$pid/stat.  The exit_code is needed to
restore zombie tasks.

Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Andrew Vagin &lt;avagin@openvz.org&gt;
Cc: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs, proc: introduce /proc/&lt;pid&gt;/task/&lt;tid&gt;/children entry</title>
<updated>2012-06-01T00:49:32Z</updated>
<author>
<name>Cyrill Gorcunov</name>
<email>gorcunov@openvz.org</email>
</author>
<published>2012-05-31T23:26:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=818411616baf46ceba0cff6f05af3a9b294734f7'/>
<id>urn:sha1:818411616baf46ceba0cff6f05af3a9b294734f7</id>
<content type='text'>
When we do checkpoint of a task we need to know the list of children the
task, has but there is no easy and fast way to generate reverse
parent-&gt;children chain from arbitrary &lt;pid&gt; (while a parent pid is
provided in "PPid" field of /proc/&lt;pid&gt;/status).

So instead of walking over all pids in the system (creating one big
process tree in memory, just to figure out which children a task has) --
we add explicit /proc/&lt;pid&gt;/task/&lt;tid&gt;/children entry, because the kernel
already has this kind of information but it is not yet exported.

This is a first level children, not the whole process tree.

Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Reviewed-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc/smaps: show amount of nonlinear ptes in vma</title>
<updated>2012-06-01T00:49:29Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@openvz.org</email>
</author>
<published>2012-05-31T23:26:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bca15543736f9be6d84e0bbc262ea7069076b9e6'/>
<id>urn:sha1:bca15543736f9be6d84e0bbc262ea7069076b9e6</id>
<content type='text'>
Currently, nonlinear mappings can not be distinguished from ordinary
mappings.  This patch adds into /proc/pid/smaps line "Nonlinear: &lt;size&gt;
kB", where size is amount of nonlinear ptes in vma, this line appears only
if VM_NONLINEAR is set.  This information may be useful not only for
checkpoint/restore project.

Requested by Pavel Emelyanov.

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc/smaps: carefully handle migration entries</title>
<updated>2012-06-01T00:49:29Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@openvz.org</email>
</author>
<published>2012-05-31T23:26:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b1d4d9e0cbd0aecf40c3572e0c8f98de31b3b328'/>
<id>urn:sha1:b1d4d9e0cbd0aecf40c3572e0c8f98de31b3b328</id>
<content type='text'>
Currently smaps reports migration entries as "swap", as result "swap" can
appears in shared mapping.

This patch converts migration entries into pages and handles them as usual.

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: report file/anon bit in /proc/pid/pagemap</title>
<updated>2012-06-01T00:49:29Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@openvz.org</email>
</author>
<published>2012-05-31T23:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=052fb0d635df5d49dfc85687d94e1a87bf09378d'/>
<id>urn:sha1:052fb0d635df5d49dfc85687d94e1a87bf09378d</id>
<content type='text'>
This is an implementation of Andrew's proposal to extend the pagemap file
bits to report what is missing about tasks' working set.

The problem with the working set detection is multilateral.  In the criu
(checkpoint/restore) project we dump the tasks' memory into image files
and to do it properly we need to detect which pages inside mappings are
really in use.  The mincore syscall I though could help with this did not.
 First, it doesn't report swapped pages, thus we cannot find out which
parts of anonymous mappings to dump.  Next, it does report pages from page
cache as present even if they are not mapped, and it doesn't make that has
not been cow-ed.

Note, that issue with swap pages is critical -- we must dump swap pages to
image file.  But the issues with file pages are optimization -- we can
take all file pages to image, this would be correct, but if we know that a
page is not mapped or not cow-ed, we can remove them from dump file.  The
dump would still be self-consistent, though significantly smaller in size
(up to 10 times smaller on real apps).

Andrew noticed, that the proc pagemap file solved 2 of 3 above issues --
it reports whether a page is present or swapped and it doesn't report not
mapped page cache pages.  But, it doesn't distinguish cow-ed file pages
from not cow-ed.

I would like to make the last unused bit in this file to report whether the
page mapped into respective pte is PageAnon or not.

[comment stolen from Pavel Emelyanov's v1 patch]

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Matt Mackall &lt;mpm@selenic.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Acked-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>procfs: use more apprioriate types when dumping /proc/N/stat</title>
<updated>2012-06-01T00:49:29Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2012-05-31T23:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=715be1fce0d964aca15618b24f6f415f3cbd03c8'/>
<id>urn:sha1:715be1fce0d964aca15618b24f6f415f3cbd03c8</id>
<content type='text'>
- use int fpr priority and nice, since task_nice()/task_prio() return that

- field 24: get_mm_rss() returns unsigned long

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: pass "fd" by value in /proc/*/{fd,fdinfo} code</title>
<updated>2012-06-01T00:49:29Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2012-05-31T23:26:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=af5e6171437c9d62d84459b24877c94c23782676'/>
<id>urn:sha1:af5e6171437c9d62d84459b24877c94c23782676</id>
<content type='text'>
Pass "fd" directly, not via pointer -- one less memory read.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: don't do dummy rcu_read_lock/rcu_read_unlock on error path</title>
<updated>2012-06-01T00:49:29Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2012-05-31T23:26:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f05ed3f1abefd37c08fbf08c766d2abd40607777'/>
<id>urn:sha1:f05ed3f1abefd37c08fbf08c766d2abd40607777</id>
<content type='text'>
rcu_read_lock()/rcu_read_unlock() is nop for TINY_RCU, but is not a nop
for, say, PREEMPT_RCU.

proc_fill_cache() is called without RCU lock, there is no need to
lock/unlock on error path, simply jump out of the loop.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: use mm_access() instead of ptrace_may_access()</title>
<updated>2012-06-01T00:49:29Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2012-05-31T23:26:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2344bec788b097b2d1198758bd29c583812b864e'/>
<id>urn:sha1:2344bec788b097b2d1198758bd29c583812b864e</id>
<content type='text'>
mm_access() handles this much better, and avoids some race conditions.

Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
