linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: mhocko@kernel.org, willy@infradead.org,
	ldufour@linux.vnet.ibm.com, vbabka@suse.cz, kirill@shutemov.name,
	akpm@linux-foundation.org
Cc: dave.hansen@intel.com, oleg@redhat.com,
	srikar@linux.vnet.ibm.com, yang.shi@linux.alibaba.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [v11 PATCH 2/3] mm: unmap VM_HUGETLB mappings with optimized path
Date: Thu, 20 Sep 2018 01:03:40 +0800	[thread overview]
Message-ID: <1537376621-51150-3-git-send-email-yang.shi@linux.alibaba.com> (raw)
In-Reply-To: <1537376621-51150-1-git-send-email-yang.shi@linux.alibaba.com>

When unmapping VM_HUGETLB mappings, vm flags need to be updated. Since
the vmas have been detached, so it sounds safe to update vm flags with
read mmap_sem.

Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
---
 mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 982dd00..490340e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2777,7 +2777,7 @@ static int __do_munmap(struct mm_struct *mm, unsigned long start, size_t len,
 			 * update vm_flags.
 			 */
 			if (downgrade &&
-			    (tmp->vm_flags & (VM_HUGETLB | VM_PFNMAP)))
+			    (tmp->vm_flags & VM_PFNMAP))
 				downgrade = false;
 
 			tmp = tmp->vm_next;
-- 
1.8.3.1


  parent reply	other threads:[~2018-09-19 17:04 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
2018-09-19 17:03 ` Yang Shi [this message]
2018-09-26 11:10   ` [v11 PATCH 2/3] mm: unmap VM_HUGETLB mappings with optimized path 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=1537376621-51150-3-git-send-email-yang.shi@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --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=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /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).