[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0d65866-8977-fba9-28fd-90873fc3d606@suse.cz>
Date: Wed, 26 Sep 2018 13:09:36 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Yang Shi <yang.shi@...ux.alibaba.com>, mhocko@...nel.org,
willy@...radead.org, ldufour@...ux.vnet.ibm.com,
kirill@...temov.name, akpm@...ux-foundation.org
Cc: dave.hansen@...el.com, oleg@...hat.com, srikar@...ux.vnet.ibm.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [v11 PATCH 1/3] mm: mmap: zap pages with read mmap_sem in munmap
On 9/19/18 7:03 PM, Yang Shi wrote:
...
> Suggested-by: Michal Hocko <mhocko@...nel.org>
> Suggested-by: Kirill A. Shutemov <kirill@...temov.name>
> Suggested-by: Matthew Wilcox <willy@...radead.org>
> Reviewed-by: Matthew Wilcox <willy@...radead.org>
> Cc: Laurent Dufour <ldufour@...ux.vnet.ibm.com>
> Cc: Vlastimil Babka <vbabka@...e.cz>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Yang Shi <yang.shi@...ux.alibaba.com>
This is indeed much better code structure. Thanks for persisting with
the series and following the suggestions.
Acked-by: Vlastimil Babka <vbabka@...e.cz>
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?
Powered by blists - more mailing lists