History

fs/proc/task_mmu.c: fix Locked field in /proc/pid/smaps*

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.

Vlastimil Babka committed 8 years ago

Commit e70cc2b1 parent bce73e41 file · +2 −1Browse files

Unified · Split

fs/proc/task_mmu.c+2−1
@@ -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) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t