<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/proc, branch v5.7-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge tag 'timers-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2020-04-19T18:46:21+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-04-19T18:46:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3e0dea57686d8a0cb8b870de0f5ccbd2e941d8b3'/>
<id>3e0dea57686d8a0cb8b870de0f5ccbd2e941d8b3</id>
<content type='text'>
Pull time namespace fix from Thomas Gleixner:
 "An update for the proc interface of time namespaces: Use symbolic
  names instead of clockid numbers. The usability nuisance of numbers
  was noticed by Michael when polishing the man page"

* tag 'timers-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  proc, time/namespace: Show clock symbolic names in /proc/pid/timens_offsets
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull time namespace fix from Thomas Gleixner:
 "An update for the proc interface of time namespaces: Use symbolic
  names instead of clockid numbers. The usability nuisance of numbers
  was noticed by Michael when polishing the man page"

* tag 'timers-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  proc, time/namespace: Show clock symbolic names in /proc/pid/timens_offsets
</pre>
</div>
</content>
</entry>
<entry>
<title>proc, time/namespace: Show clock symbolic names in /proc/pid/timens_offsets</title>
<updated>2020-04-16T10:10:54+00:00</updated>
<author>
<name>Andrei Vagin</name>
<email>avagin@gmail.com</email>
</author>
<published>2020-04-11T15:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=94d440d618467806009c8edc70b094d64e12ee5a'/>
<id>94d440d618467806009c8edc70b094d64e12ee5a</id>
<content type='text'>
Michael Kerrisk suggested to replace numeric clock IDs with symbolic names.

Now the content of these files looks like this:
$ cat /proc/774/timens_offsets
monotonic      864000         0
boottime      1728000         0

For setting offsets, both representations of clocks (numeric and symbolic)
can be used.

As for compatibility, it is acceptable to change things as long as
userspace doesn't care. The format of timens_offsets files is very new and
there are no userspace tools yet which rely on this format.

But three projects crun, util-linux and criu rely on the interface of
setting time offsets and this is why it's required to continue supporting
the numeric clock IDs on write.

Fixes: 04a8682a71be ("fs/proc: Introduce /proc/pid/timens_offsets")
Suggested-by: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Signed-off-by: Andrei Vagin &lt;avagin@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Acked-by: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20200411154031.642557-1-avagin@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Michael Kerrisk suggested to replace numeric clock IDs with symbolic names.

Now the content of these files looks like this:
$ cat /proc/774/timens_offsets
monotonic      864000         0
boottime      1728000         0

For setting offsets, both representations of clocks (numeric and symbolic)
can be used.

As for compatibility, it is acceptable to change things as long as
userspace doesn't care. The format of timens_offsets files is very new and
there are no userspace tools yet which rely on this format.

But three projects crun, util-linux and criu rely on the interface of
setting time offsets and this is why it's required to continue supporting
the numeric clock IDs on write.

Fixes: 04a8682a71be ("fs/proc: Introduce /proc/pid/timens_offsets")
Suggested-by: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Signed-off-by: Andrei Vagin &lt;avagin@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Acked-by: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20200411154031.642557-1-avagin@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>proc: Handle umounts cleanly</title>
<updated>2020-04-16T04:52:29+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2020-04-15T17:37:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4fa3b1c417377c352208ee9f487e17cfcee32348'/>
<id>4fa3b1c417377c352208ee9f487e17cfcee32348</id>
<content type='text'>
syzbot writes:
&gt; KASAN: use-after-free Read in dput (2)
&gt;
&gt; proc_fill_super: allocate dentry failed
&gt; ==================================================================
&gt; BUG: KASAN: use-after-free in fast_dput fs/dcache.c:727 [inline]
&gt; BUG: KASAN: use-after-free in dput+0x53e/0xdf0 fs/dcache.c:846
&gt; Read of size 4 at addr ffff88808a618cf0 by task syz-executor.0/8426
&gt;
&gt; CPU: 0 PID: 8426 Comm: syz-executor.0 Not tainted 5.6.0-next-20200412-syzkaller #0
&gt; Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
&gt; Call Trace:
&gt;  __dump_stack lib/dump_stack.c:77 [inline]
&gt;  dump_stack+0x188/0x20d lib/dump_stack.c:118
&gt;  print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:382
&gt;  __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511
&gt;  kasan_report+0x33/0x50 mm/kasan/common.c:625
&gt;  fast_dput fs/dcache.c:727 [inline]
&gt;  dput+0x53e/0xdf0 fs/dcache.c:846
&gt;  proc_kill_sb+0x73/0xf0 fs/proc/root.c:195
&gt;  deactivate_locked_super+0x8c/0xf0 fs/super.c:335
&gt;  vfs_get_super+0x258/0x2d0 fs/super.c:1212
&gt;  vfs_get_tree+0x89/0x2f0 fs/super.c:1547
&gt;  do_new_mount fs/namespace.c:2813 [inline]
&gt;  do_mount+0x1306/0x1b30 fs/namespace.c:3138
&gt;  __do_sys_mount fs/namespace.c:3347 [inline]
&gt;  __se_sys_mount fs/namespace.c:3324 [inline]
&gt;  __x64_sys_mount+0x18f/0x230 fs/namespace.c:3324
&gt;  do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
&gt;  entry_SYSCALL_64_after_hwframe+0x49/0xb3
&gt; RIP: 0033:0x45c889
&gt; Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 &lt;48&gt; 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
&gt; RSP: 002b:00007ffc1930ec48 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
&gt; RAX: ffffffffffffffda RBX: 0000000001324914 RCX: 000000000045c889
&gt; RDX: 0000000020000140 RSI: 0000000020000040 RDI: 0000000000000000
&gt; RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000
&gt; R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
&gt; R13: 0000000000000749 R14: 00000000004ca15a R15: 0000000000000013

Looking at the code now that it the internal mount of proc is no
longer used it is possible to unmount proc.   If proc is unmounted
the fields of the pid namespace that were used for filesystem
specific state are not reinitialized.

Which means that proc_self and proc_thread_self can be pointers to
already freed dentries.

The reported user after free appears to be from mounting and
unmounting proc followed by mounting proc again and using error
injection to cause the new root dentry allocation to fail.  This in
turn results in proc_kill_sb running with proc_self and
proc_thread_self still retaining their values from the previous mount
of proc.  Then calling dput on either proc_self of proc_thread_self
will result in double put.  Which KASAN sees as a use after free.

Solve this by always reinitializing the filesystem state stored
in the struct pid_namespace, when proc is unmounted.

Reported-by: syzbot+72868dd424eb66c6b95f@syzkaller.appspotmail.com
Acked-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
Fixes: 69879c01a0c3 ("proc: Remove the now unnecessary internal mount of proc")
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
syzbot writes:
&gt; KASAN: use-after-free Read in dput (2)
&gt;
&gt; proc_fill_super: allocate dentry failed
&gt; ==================================================================
&gt; BUG: KASAN: use-after-free in fast_dput fs/dcache.c:727 [inline]
&gt; BUG: KASAN: use-after-free in dput+0x53e/0xdf0 fs/dcache.c:846
&gt; Read of size 4 at addr ffff88808a618cf0 by task syz-executor.0/8426
&gt;
&gt; CPU: 0 PID: 8426 Comm: syz-executor.0 Not tainted 5.6.0-next-20200412-syzkaller #0
&gt; Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
&gt; Call Trace:
&gt;  __dump_stack lib/dump_stack.c:77 [inline]
&gt;  dump_stack+0x188/0x20d lib/dump_stack.c:118
&gt;  print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:382
&gt;  __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511
&gt;  kasan_report+0x33/0x50 mm/kasan/common.c:625
&gt;  fast_dput fs/dcache.c:727 [inline]
&gt;  dput+0x53e/0xdf0 fs/dcache.c:846
&gt;  proc_kill_sb+0x73/0xf0 fs/proc/root.c:195
&gt;  deactivate_locked_super+0x8c/0xf0 fs/super.c:335
&gt;  vfs_get_super+0x258/0x2d0 fs/super.c:1212
&gt;  vfs_get_tree+0x89/0x2f0 fs/super.c:1547
&gt;  do_new_mount fs/namespace.c:2813 [inline]
&gt;  do_mount+0x1306/0x1b30 fs/namespace.c:3138
&gt;  __do_sys_mount fs/namespace.c:3347 [inline]
&gt;  __se_sys_mount fs/namespace.c:3324 [inline]
&gt;  __x64_sys_mount+0x18f/0x230 fs/namespace.c:3324
&gt;  do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
&gt;  entry_SYSCALL_64_after_hwframe+0x49/0xb3
&gt; RIP: 0033:0x45c889
&gt; Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 &lt;48&gt; 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
&gt; RSP: 002b:00007ffc1930ec48 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
&gt; RAX: ffffffffffffffda RBX: 0000000001324914 RCX: 000000000045c889
&gt; RDX: 0000000020000140 RSI: 0000000020000040 RDI: 0000000000000000
&gt; RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000
&gt; R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
&gt; R13: 0000000000000749 R14: 00000000004ca15a R15: 0000000000000013

Looking at the code now that it the internal mount of proc is no
longer used it is possible to unmount proc.   If proc is unmounted
the fields of the pid namespace that were used for filesystem
specific state are not reinitialized.

Which means that proc_self and proc_thread_self can be pointers to
already freed dentries.

The reported user after free appears to be from mounting and
unmounting proc followed by mounting proc again and using error
injection to cause the new root dentry allocation to fail.  This in
turn results in proc_kill_sb running with proc_self and
proc_thread_self still retaining their values from the previous mount
of proc.  Then calling dput on either proc_self of proc_thread_self
will result in double put.  Which KASAN sees as a use after free.

Solve this by always reinitializing the filesystem state stored
in the struct pid_namespace, when proc is unmounted.

Reported-by: syzbot+72868dd424eb66c6b95f@syzkaller.appspotmail.com
Acked-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
Fixes: 69879c01a0c3 ("proc: Remove the now unnecessary internal mount of proc")
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace</title>
<updated>2020-04-10T19:59:56+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-04-10T19:59:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=87ad46e601340394cd75c1c79b19ca906f82c543'/>
<id>87ad46e601340394cd75c1c79b19ca906f82c543</id>
<content type='text'>
Pull proc fix from Eric Biederman:
 "A brown paper bag slipped through my proc changes, and syzcaller
  caught it when the code ended up in your tree.

  I have opted to fix it the simplest cleanest way I know how, so there
  is no reasonable chance for the bug to repeat"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  proc: Use a dedicated lock in struct pid
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull proc fix from Eric Biederman:
 "A brown paper bag slipped through my proc changes, and syzcaller
  caught it when the code ended up in your tree.

  I have opted to fix it the simplest cleanest way I know how, so there
  is no reasonable chance for the bug to repeat"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  proc: Use a dedicated lock in struct pid
</pre>
</div>
</content>
</entry>
<entry>
<title>proc: Use a dedicated lock in struct pid</title>
<updated>2020-04-09T17:15:35+00:00</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2020-04-07T14:43:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=63f818f46af9f8b3f17b9695501e8d08959feb60'/>
<id>63f818f46af9f8b3f17b9695501e8d08959feb60</id>
<content type='text'>
syzbot wrote:
&gt; ========================================================
&gt; WARNING: possible irq lock inversion dependency detected
&gt; 5.6.0-syzkaller #0 Not tainted
&gt; --------------------------------------------------------
&gt; swapper/1/0 just changed the state of lock:
&gt; ffffffff898090d8 (tasklist_lock){.+.?}-{2:2}, at: send_sigurg+0x9f/0x320 fs/fcntl.c:840
&gt; but this lock took another, SOFTIRQ-unsafe lock in the past:
&gt;  (&amp;pid-&gt;wait_pidfd){+.+.}-{2:2}
&gt;
&gt;
&gt; and interrupts could create inverse lock ordering between them.
&gt;
&gt;
&gt; other info that might help us debug this:
&gt;  Possible interrupt unsafe locking scenario:
&gt;
&gt;        CPU0                    CPU1
&gt;        ----                    ----
&gt;   lock(&amp;pid-&gt;wait_pidfd);
&gt;                                local_irq_disable();
&gt;                                lock(tasklist_lock);
&gt;                                lock(&amp;pid-&gt;wait_pidfd);
&gt;   &lt;Interrupt&gt;
&gt;     lock(tasklist_lock);
&gt;
&gt;  *** DEADLOCK ***
&gt;
&gt; 4 locks held by swapper/1/0:

The problem is that because wait_pidfd.lock is taken under the tasklist
lock.  It must always be taken with irqs disabled as tasklist_lock can be
taken from interrupt context and if wait_pidfd.lock was already taken this
would create a lock order inversion.

Oleg suggested just disabling irqs where I have added extra calls to
wait_pidfd.lock.  That should be safe and I think the code will eventually
do that.  It was rightly pointed out by Christian that sharing the
wait_pidfd.lock was a premature optimization.

It is also true that my pre-merge window testing was insufficient.  So
remove the premature optimization and give struct pid a dedicated lock of
it's own for struct pid things.  I have verified that lockdep sees all 3
paths where we take the new pid-&gt;lock and lockdep does not complain.

It is my current day dream that one day pid-&gt;lock can be used to guard the
task lists as well and then the tasklist_lock won't need to be held to
deliver signals.  That will require taking pid-&gt;lock with irqs disabled.

Acked-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
Link: https://lore.kernel.org/lkml/00000000000011d66805a25cd73f@google.com/
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
Reported-by: syzbot+343f75cdeea091340956@syzkaller.appspotmail.com
Reported-by: syzbot+832aabf700bc3ec920b9@syzkaller.appspotmail.com
Reported-by: syzbot+f675f964019f884dbd0f@syzkaller.appspotmail.com
Reported-by: syzbot+a9fb1457d720a55d6dc5@syzkaller.appspotmail.com
Fixes: 7bc3e6e55acf ("proc: Use a list of inodes to flush from proc")
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
syzbot wrote:
&gt; ========================================================
&gt; WARNING: possible irq lock inversion dependency detected
&gt; 5.6.0-syzkaller #0 Not tainted
&gt; --------------------------------------------------------
&gt; swapper/1/0 just changed the state of lock:
&gt; ffffffff898090d8 (tasklist_lock){.+.?}-{2:2}, at: send_sigurg+0x9f/0x320 fs/fcntl.c:840
&gt; but this lock took another, SOFTIRQ-unsafe lock in the past:
&gt;  (&amp;pid-&gt;wait_pidfd){+.+.}-{2:2}
&gt;
&gt;
&gt; and interrupts could create inverse lock ordering between them.
&gt;
&gt;
&gt; other info that might help us debug this:
&gt;  Possible interrupt unsafe locking scenario:
&gt;
&gt;        CPU0                    CPU1
&gt;        ----                    ----
&gt;   lock(&amp;pid-&gt;wait_pidfd);
&gt;                                local_irq_disable();
&gt;                                lock(tasklist_lock);
&gt;                                lock(&amp;pid-&gt;wait_pidfd);
&gt;   &lt;Interrupt&gt;
&gt;     lock(tasklist_lock);
&gt;
&gt;  *** DEADLOCK ***
&gt;
&gt; 4 locks held by swapper/1/0:

The problem is that because wait_pidfd.lock is taken under the tasklist
lock.  It must always be taken with irqs disabled as tasklist_lock can be
taken from interrupt context and if wait_pidfd.lock was already taken this
would create a lock order inversion.

Oleg suggested just disabling irqs where I have added extra calls to
wait_pidfd.lock.  That should be safe and I think the code will eventually
do that.  It was rightly pointed out by Christian that sharing the
wait_pidfd.lock was a premature optimization.

It is also true that my pre-merge window testing was insufficient.  So
remove the premature optimization and give struct pid a dedicated lock of
it's own for struct pid things.  I have verified that lockdep sees all 3
paths where we take the new pid-&gt;lock and lockdep does not complain.

It is my current day dream that one day pid-&gt;lock can be used to guard the
task lists as well and then the tasklist_lock won't need to be held to
deliver signals.  That will require taking pid-&gt;lock with irqs disabled.

Acked-by: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
Link: https://lore.kernel.org/lkml/00000000000011d66805a25cd73f@google.com/
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Christian Brauner &lt;christian.brauner@ubuntu.com&gt;
Reported-by: syzbot+343f75cdeea091340956@syzkaller.appspotmail.com
Reported-by: syzbot+832aabf700bc3ec920b9@syzkaller.appspotmail.com
Reported-by: syzbot+f675f964019f884dbd0f@syzkaller.appspotmail.com
Reported-by: syzbot+a9fb1457d720a55d6dc5@syzkaller.appspotmail.com
Fixes: 7bc3e6e55acf ("proc: Use a list of inodes to flush from proc")
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>proc: inline m_next_vma into m_next</title>
<updated>2020-04-07T17:43:42+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2020-04-07T03:09:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fad955009c2ba49e2eac98926ad5cce48b777e7e'/>
<id>fad955009c2ba49e2eac98926ad5cce48b777e7e</id>
<content type='text'>
It's clearer to just put this inline.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200317193201.9924-5-adobriyan@gmail.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's clearer to just put this inline.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200317193201.9924-5-adobriyan@gmail.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>proc: use ppos instead of m-&gt;version</title>
<updated>2020-04-07T17:43:42+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2020-04-07T03:09:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4781f2c3abddc400cfdb6ed18c2bf655d402efb5'/>
<id>4781f2c3abddc400cfdb6ed18c2bf655d402efb5</id>
<content type='text'>
The ppos is a private cursor, just like m-&gt;version.  Use the canonical
cursor, not a special one.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200317193201.9924-3-adobriyan@gmail.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ppos is a private cursor, just like m-&gt;version.  Use the canonical
cursor, not a special one.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200317193201.9924-3-adobriyan@gmail.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>proc: remove m_cache_vma</title>
<updated>2020-04-07T17:43:42+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2020-04-07T03:09:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c2e88d22e8ea698c183c6c36485c134742b99838'/>
<id>c2e88d22e8ea698c183c6c36485c134742b99838</id>
<content type='text'>
Instead of setting m-&gt;version in the show method, set it in m_next(),
where it should be.  Also remove the fallback code for failing to find a
vma, or version being zero.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200317193201.9924-2-adobriyan@gmail.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of setting m-&gt;version in the show method, set it in m_next(),
where it should be.  Also remove the fallback code for failing to find a
vma, or version being zero.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200317193201.9924-2-adobriyan@gmail.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>proc: inline vma_stop into m_stop</title>
<updated>2020-04-07T17:43:42+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2020-04-07T03:09:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d07ded611e46d276d41dafcbd6abc9dd7ab51a7f'/>
<id>d07ded611e46d276d41dafcbd6abc9dd7ab51a7f</id>
<content type='text'>
Instead of calling vma_stop() from m_start() and m_next(), do its work
in m_stop().

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200317193201.9924-1-adobriyan@gmail.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of calling vma_stop() from m_start() and m_next(), do its work
in m_stop().

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200317193201.9924-1-adobriyan@gmail.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>proc: speed up /proc/*/statm</title>
<updated>2020-04-07T17:43:42+00:00</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2020-04-07T03:09:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5c5ab9714c2225d50119e397c537ad5e568f268b'/>
<id>5c5ab9714c2225d50119e397c537ad5e568f268b</id>
<content type='text'>
top(1) reads all /proc/*/statm files but kernel threads will always have
zeros.  Print those zeroes directly without going through
seq_put_decimal_ull().

Speed up reading /proc/2/statm (which is kthreadd) is like 3%.

My system has more kernel threads than normal processes after booting KDE.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200307154435.GA2788@avx2
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
top(1) reads all /proc/*/statm files but kernel threads will always have
zeros.  Print those zeroes directly without going through
seq_put_decimal_ull().

Speed up reading /proc/2/statm (which is kthreadd) is like 3%.

My system has more kernel threads than normal processes after booting KDE.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20200307154435.GA2788@avx2
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
