linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: do not show ?? for VM_LOCKONFAULT pages
@ 2022-12-05 17:30 Jason A. Donenfeld
  2022-12-06 21:48 ` Vlastimil Babka
  0 siblings, 1 reply; 2+ messages in thread
From: Jason A. Donenfeld @ 2022-12-05 17:30 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Jason A. Donenfeld, Eric B Munson, Kirill A . Shutemov,
	Vlastimil Babka, Andrew Morton

When VM_LOCKONFAULT was added, /proc/PID/smaps wasn't hooked up to it,
so looking at /proc/PID/smaps, it shows '??' instead of something
intelligable. This can be reached by userspace by simply calling
`mlock2(..., MLOCK_ONFAULT);`.

Fix this by adding "lf" to denote VM_LOCKONFAULT.

Cc: Eric B Munson <emunson@akamai.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Fixes: de60f5f10c58 ("mm: introduce VM_LOCKONFAULT")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 fs/proc/task_mmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 8a74cdcc9af0..60851e96530b 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -667,6 +667,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
 		[ilog2(VM_RAND_READ)]	= "rr",
 		[ilog2(VM_DONTCOPY)]	= "dc",
 		[ilog2(VM_DONTEXPAND)]	= "de",
+		[ilog2(VM_LOCKONFAULT)]	= "lf",
 		[ilog2(VM_ACCOUNT)]	= "ac",
 		[ilog2(VM_NORESERVE)]	= "nr",
 		[ilog2(VM_HUGETLB)]	= "ht",
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: do not show ?? for VM_LOCKONFAULT pages
  2022-12-05 17:30 [PATCH] mm: do not show ?? for VM_LOCKONFAULT pages Jason A. Donenfeld
@ 2022-12-06 21:48 ` Vlastimil Babka
  0 siblings, 0 replies; 2+ messages in thread
From: Vlastimil Babka @ 2022-12-06 21:48 UTC (permalink / raw)
  To: Jason A. Donenfeld, linux-mm, linux-kernel
  Cc: Eric B Munson, Kirill A . Shutemov, Andrew Morton

On 12/5/22 18:30, Jason A. Donenfeld wrote:
> When VM_LOCKONFAULT was added, /proc/PID/smaps wasn't hooked up to it,
> so looking at /proc/PID/smaps, it shows '??' instead of something
> intelligable. This can be reached by userspace by simply calling
> `mlock2(..., MLOCK_ONFAULT);`.
> 
> Fix this by adding "lf" to denote VM_LOCKONFAULT.
> 
> Cc: Eric B Munson <emunson@akamai.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Fixes: de60f5f10c58 ("mm: introduce VM_LOCKONFAULT")
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  fs/proc/task_mmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 8a74cdcc9af0..60851e96530b 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -667,6 +667,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
>  		[ilog2(VM_RAND_READ)]	= "rr",
>  		[ilog2(VM_DONTCOPY)]	= "dc",
>  		[ilog2(VM_DONTEXPAND)]	= "de",
> +		[ilog2(VM_LOCKONFAULT)]	= "lf",
>  		[ilog2(VM_ACCOUNT)]	= "ac",
>  		[ilog2(VM_NORESERVE)]	= "nr",
>  		[ilog2(VM_HUGETLB)]	= "ht",


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-06 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-05 17:30 [PATCH] mm: do not show ?? for VM_LOCKONFAULT pages Jason A. Donenfeld
2022-12-06 21:48 ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).