Thomas reports: "While looking around in /proc on my v4.14.52 system I noticed that all processes got a lot of "Locked" memory in /proc/*/smaps. A lot more memory than a regular user can usually lock with mlock(). Commit 493b0e9d945f (in v4.14-rc1) seems to have changed the behavior of "Locked". Before that commit the code was like this. Notice the VM_LOCKED check. (vma->vm_flags & VM_LOCKED) ? (unsigned long)(mss.pss >> (10 + PSS_SHIFT)) : 0); After that commit Locked is now the same as Pss: (unsigned long)(mss->pss >> (10 + PSS_SHIFT))); This looks like a mistake." Indeed, the commit has added mss->pss_locked with the correct value that depends on VM_LOCKED, but forgot to actually use it. Fix it.
Unified · Split
| @@ -831,7 +831,8 @@ static int show_smap(struct seq_file *m, void *v, int is_pid) · 830 unmodified lines | |||
| 831 | SEQ_PUT_DEC(" kB\nSwap: ", mss->swap); | 831 | SEQ_PUT_DEC(" kB\nSwap: ", mss->swap); |
| 832 | SEQ_PUT_DEC(" kB\nSwapPss: ", | 832 | SEQ_PUT_DEC(" kB\nSwapPss: ", |
| 833 | mss->swap_pss >> PSS_SHIFT); | 833 | mss->swap_pss >> PSS_SHIFT); |
| 834 | SEQ_PUT_DEC(" kB\nLocked: ", mss->pss >> PSS_SHIFT); | 834 | SEQ_PUT_DEC(" kB\nLocked: ", |
| 835 | mss->pss_locked >> PSS_SHIFT); | ||
| 835 | seq_puts(m, " kB\n"); | 836 | seq_puts(m, " kB\n"); |
| 836 | } | 837 | } |
| 837 | if (!rollup_mode) { | 838 | if (!rollup_mode) { |