2019-04-25 23:24:40

by Yang Shi

[permalink] [raw]
Subject: [PATCH] mm: filemap: correct the comment about VM_FAULT_RETRY

The commit 6b4c9f446981 ("filemap: drop the mmap_sem for all blocking
operations") changed when mmap_sem is dropped during filemap page fault
and when returning VM_FAULT_RETRY.

Correct the comment to reflect the change.

Cc: Josef Bacik <[email protected]>
Signed-off-by: Yang Shi <[email protected]>
---
mm/filemap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index d78f577..f0d6250 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2545,10 +2545,8 @@ static struct file *do_async_mmap_readahead(struct vm_fault *vmf,
*
* vma->vm_mm->mmap_sem must be held on entry.
*
- * If our return value has VM_FAULT_RETRY set, it's because
- * lock_page_or_retry() returned 0.
- * The mmap_sem has usually been released in this case.
- * See __lock_page_or_retry() for the exception.
+ * If our return value has VM_FAULT_RETRY set, it's because the mmap_sem
+ * may be dropped before doing I/O or by lock_page_maybe_drop_mmap().
*
* If our return value does not have VM_FAULT_RETRY set, the mmap_sem
* has not been released.
--
1.8.3.1


2019-05-08 16:56:39

by Yang Shi

[permalink] [raw]
Subject: Re: [PATCH] mm: filemap: correct the comment about VM_FAULT_RETRY

Ping.


Josef, any comment on this one?


Thanks,

Yang



On 4/25/19 4:22 PM, Yang Shi wrote:
> The commit 6b4c9f446981 ("filemap: drop the mmap_sem for all blocking
> operations") changed when mmap_sem is dropped during filemap page fault
> and when returning VM_FAULT_RETRY.
>
> Correct the comment to reflect the change.
>
> Cc: Josef Bacik <[email protected]>
> Signed-off-by: Yang Shi <[email protected]>
> ---
> mm/filemap.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/mm/filemap.c b/mm/filemap.c
> index d78f577..f0d6250 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2545,10 +2545,8 @@ static struct file *do_async_mmap_readahead(struct vm_fault *vmf,
> *
> * vma->vm_mm->mmap_sem must be held on entry.
> *
> - * If our return value has VM_FAULT_RETRY set, it's because
> - * lock_page_or_retry() returned 0.
> - * The mmap_sem has usually been released in this case.
> - * See __lock_page_or_retry() for the exception.
> + * If our return value has VM_FAULT_RETRY set, it's because the mmap_sem
> + * may be dropped before doing I/O or by lock_page_maybe_drop_mmap().
> *
> * If our return value does not have VM_FAULT_RETRY set, the mmap_sem
> * has not been released.

2019-05-14 22:52:52

by Yang Shi

[permalink] [raw]
Subject: Re: [PATCH] mm: filemap: correct the comment about VM_FAULT_RETRY

Hi Josef,

Any comment on this patch? I switched to my personal email since the
mail may get bounced back with my work email sometime.


On Wed, May 8, 2019 at 9:55 AM Yang Shi <[email protected]> wrote:
>
> Ping.
>
>
> Josef, any comment on this one?
>
>
> Thanks,
>
> Yang
>
>
>
> On 4/25/19 4:22 PM, Yang Shi wrote:
> > The commit 6b4c9f446981 ("filemap: drop the mmap_sem for all blocking
> > operations") changed when mmap_sem is dropped during filemap page fault
> > and when returning VM_FAULT_RETRY.
> >
> > Correct the comment to reflect the change.
> >
> > Cc: Josef Bacik <[email protected]>
> > Signed-off-by: Yang Shi <[email protected]>
> > ---
> > mm/filemap.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/mm/filemap.c b/mm/filemap.c
> > index d78f577..f0d6250 100644
> > --- a/mm/filemap.c
> > +++ b/mm/filemap.c
> > @@ -2545,10 +2545,8 @@ static struct file *do_async_mmap_readahead(struct vm_fault *vmf,
> > *
> > * vma->vm_mm->mmap_sem must be held on entry.
> > *
> > - * If our return value has VM_FAULT_RETRY set, it's because
> > - * lock_page_or_retry() returned 0.
> > - * The mmap_sem has usually been released in this case.
> > - * See __lock_page_or_retry() for the exception.
> > + * If our return value has VM_FAULT_RETRY set, it's because the mmap_sem
> > + * may be dropped before doing I/O or by lock_page_maybe_drop_mmap().
> > *
> > * If our return value does not have VM_FAULT_RETRY set, the mmap_sem
> > * has not been released.
>

2019-05-14 23:42:42

by Song Liu

[permalink] [raw]
Subject: Re: [PATCH] mm: filemap: correct the comment about VM_FAULT_RETRY

On Thu, Apr 25, 2019 at 4:22 PM Yang Shi <[email protected]> wrote:
>
> The commit 6b4c9f446981 ("filemap: drop the mmap_sem for all blocking
> operations") changed when mmap_sem is dropped during filemap page fault
> and when returning VM_FAULT_RETRY.
>
> Correct the comment to reflect the change.
>
> Cc: Josef Bacik <[email protected]>
> Signed-off-by: Yang Shi <[email protected]>

Looks good to me!

Acked-by: Song Liu <[email protected]>

> ---
> mm/filemap.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/mm/filemap.c b/mm/filemap.c
> index d78f577..f0d6250 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2545,10 +2545,8 @@ static struct file *do_async_mmap_readahead(struct vm_fault *vmf,
> *
> * vma->vm_mm->mmap_sem must be held on entry.
> *
> - * If our return value has VM_FAULT_RETRY set, it's because
> - * lock_page_or_retry() returned 0.
> - * The mmap_sem has usually been released in this case.
> - * See __lock_page_or_retry() for the exception.
> + * If our return value has VM_FAULT_RETRY set, it's because the mmap_sem
> + * may be dropped before doing I/O or by lock_page_maybe_drop_mmap().
> *
> * If our return value does not have VM_FAULT_RETRY set, the mmap_sem
> * has not been released.
> --
> 1.8.3.1
>

2019-05-15 16:36:06

by Josef Bacik

[permalink] [raw]
Subject: Re: [PATCH] mm: filemap: correct the comment about VM_FAULT_RETRY

On Fri, Apr 26, 2019 at 07:22:11AM +0800, Yang Shi wrote:
> The commit 6b4c9f446981 ("filemap: drop the mmap_sem for all blocking
> operations") changed when mmap_sem is dropped during filemap page fault
> and when returning VM_FAULT_RETRY.
>
> Correct the comment to reflect the change.
>
> Cc: Josef Bacik <[email protected]>
> Signed-off-by: Yang Shi <[email protected]>
> ---

Reviewed-by: Josef Bacik <[email protected]>

Thanks,

Josef