On 9/19/18 7:03 PM, Yang Shi wrote:

...

> Suggested-by: Michal Hocko <[email protected]>
> Suggested-by: Kirill A. Shutemov <[email protected]>
> Suggested-by: Matthew Wilcox <[email protected]>
> Reviewed-by: Matthew Wilcox <[email protected]>
> Cc: Laurent Dufour <[email protected]>
> Cc: Vlastimil Babka <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Signed-off-by: Yang Shi <[email protected]>

This is indeed much better code structure. Thanks for persisting with
the series and following the suggestions.

Acked-by: Vlastimil Babka <[email protected]>

Nit:

> @@ -2797,17 +2819,32 @@ int vm_munmap(unsigned long start, size_t len)
>       if (down_write_killable(&mm->mmap_sem))
>               return -EINTR;
>  
> -     ret = do_munmap(mm, start, len, &uf);
> -     up_write(&mm->mmap_sem);
> +     ret = __do_munmap(mm, start, len, &uf, downgrade);
> +     /*
> +      * Returning 1 indicates mmap_sem is downgraded.
> +      * But 1 is not legal return value of vm_munmap() and munmap(), reset
> +      * it to 0 before return.
> +      */
> +     if (ret == 1) {
> +             up_read(&mm->mmap_sem);
> +             ret = 0;
> +     } else
> +             up_write(&mm->mmap_sem);
> +

I think the else part should also have { } per the kernel style?

Reply via email to