linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Yang Shi <yang.shi@linux.alibaba.com>,
	mhocko@kernel.org, willy@infradead.org,
	ldufour@linux.vnet.ibm.com, kirill@shutemov.name,
	akpm@linux-foundation.org
Cc: dave.hansen@intel.com, oleg@redhat.com,
	srikar@linux.vnet.ibm.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [v11 PATCH 1/3] mm: mmap: zap pages with read mmap_sem in munmap
Date: Wed, 26 Sep 2018 13:09:36 +0200	[thread overview]
Message-ID: <f0d65866-8977-fba9-28fd-90873fc3d606@suse.cz> (raw)
In-Reply-To: <1537376621-51150-2-git-send-email-yang.shi@linux.alibaba.com>

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

...

> Suggested-by: Michal Hocko <mhocko@kernel.org>
> Suggested-by: Kirill A. Shutemov <kirill@shutemov.name>
> Suggested-by: Matthew Wilcox <willy@infradead.org>
> Reviewed-by: Matthew Wilcox <willy@infradead.org>
> Cc: Laurent Dufour <ldufour@linux.vnet.ibm.com>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>

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

Acked-by: Vlastimil Babka <vbabka@suse.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?

  reply	other threads:[~2018-09-26 11:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 17:03 [v11 PATCH 0/3] mm: zap pages with read mmap_sem in munmap for large mapping Yang Shi
2018-09-19 17:03 ` [v11 PATCH 1/3] mm: mmap: zap pages with read mmap_sem in munmap Yang Shi
2018-09-26 11:09   ` Vlastimil Babka [this message]
2018-09-19 17:03 ` [v11 PATCH 2/3] mm: unmap VM_HUGETLB mappings with optimized path Yang Shi
2018-09-26 11:10   ` Vlastimil Babka
2018-09-19 17:03 ` [v11 PATCH 3/3] mm: unmap VM_PFNMAP " Yang Shi
2018-09-26 11:11   ` Vlastimil Babka
2018-09-26 12:35 ` [v11 PATCH 0/3] mm: zap pages with read mmap_sem in munmap for large mapping Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f0d65866-8977-fba9-28fd-90873fc3d606@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=kirill@shutemov.name \
    --cc=ldufour@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=oleg@redhat.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=willy@infradead.org \
    --cc=yang.shi@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).