linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: fix outdated incorrect code comments for handle_mm_fault()
@ 2024-12-13  3:18 Jinliang Zheng
  2024-12-13 15:24 ` Liam R. Howlett
  0 siblings, 1 reply; 3+ messages in thread
From: Jinliang Zheng @ 2024-12-13  3:18 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Jinliang Zheng

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
---
 mm/memory.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index d9af83dd86bb..d7342a726845 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -6159,7 +6159,8 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma,
 }
 
 /*
- * By the time we get here, we already hold the mm semaphore
+ * By the time we get here, we already hold either the VMA lock or the
+ * mmap_Lock (FAULT_FLAG_VMA_LOCK tells you which).
  *
  * The mmap_lock may have been released depending on flags and our
  * return value.  See filemap_fault() and __folio_lock_or_retry().
-- 
2.41.1



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

* Re: [PATCH] mm: fix outdated incorrect code comments for handle_mm_fault()
  2024-12-13  3:18 [PATCH] mm: fix outdated incorrect code comments for handle_mm_fault() Jinliang Zheng
@ 2024-12-13 15:24 ` Liam R. Howlett
  2024-12-14  2:53   ` Jinliang Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Liam R. Howlett @ 2024-12-13 15:24 UTC (permalink / raw)
  To: Jinliang Zheng; +Cc: akpm, linux-mm, linux-kernel, Jinliang Zheng

* Jinliang Zheng <alexjlzheng@gmail.com> [241212 22:18]:
> Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
> ---
>  mm/memory.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index d9af83dd86bb..d7342a726845 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -6159,7 +6159,8 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma,
>  }
>  
>  /*
> - * By the time we get here, we already hold the mm semaphore
> + * By the time we get here, we already hold either the VMA lock or the
> + * mmap_Lock (FAULT_FLAG_VMA_LOCK tells you which).
           ^ lower case here please, otherwise looking for mmap_lock
	   could fail. ie: grep mmap_lock..
>   *
>   * The mmap_lock may have been released depending on flags and our
>   * return value.  See filemap_fault() and __folio_lock_or_retry().
> -- 
> 2.41.1
> 
> 


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

* Re: [PATCH] mm: fix outdated incorrect code comments for handle_mm_fault()
  2024-12-13 15:24 ` Liam R. Howlett
@ 2024-12-14  2:53   ` Jinliang Zheng
  0 siblings, 0 replies; 3+ messages in thread
From: Jinliang Zheng @ 2024-12-14  2:53 UTC (permalink / raw)
  To: liam.howlett; +Cc: akpm, alexjlzheng, alexjlzheng, linux-kernel, linux-mm

On Fri, 13 Dec 2024 10:24:00 -0500, Liam R. Howlett wrote:
> * Jinliang Zheng <alexjlzheng@gmail.com> [241212 22:18]:
> > Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
> > ---
> >  mm/memory.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/mm/memory.c b/mm/memory.c
> > index d9af83dd86bb..d7342a726845 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -6159,7 +6159,8 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma,
> >  }
> >  
> >  /*
> > - * By the time we get here, we already hold the mm semaphore
> > + * By the time we get here, we already hold either the VMA lock or the
> > + * mmap_Lock (FAULT_FLAG_VMA_LOCK tells you which).
>            ^ lower case here please, otherwise looking for mmap_lock
> 	   could fail. ie: grep mmap_lock..

Thank you, I will send a v2 patch.

Jinliang Zheng :)

> >   *
> >   * The mmap_lock may have been released depending on flags and our
> >   * return value.  See filemap_fault() and __folio_lock_or_retry().
> > -- 
> > 2.41.1
> > 
> > 


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

end of thread, other threads:[~2024-12-14  2:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-13  3:18 [PATCH] mm: fix outdated incorrect code comments for handle_mm_fault() Jinliang Zheng
2024-12-13 15:24 ` Liam R. Howlett
2024-12-14  2:53   ` Jinliang Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox