linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chen Gang <xili_gchen_5257@hotmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"riel@redhat.com" <riel@redhat.com>,
	Michal Hocko <mhocko@suse.cz>,
	"oleg@redhat.com" <oleg@redhat.com>,
	"asha.levin@oracle.com" <asha.levin@oracle.com>,
	"pfeiner@google.com" <pfeiner@google.com>,
	"aarcange@redhat.com" <aarcange@redhat.com>,
	"vishnu.ps@samsung.com" <vishnu.ps@samsung.com>,
	Linux Memory <linux-mm@kvack.org>,
	kernel mailing list <linux-kernel@vger.kernel.org>
Subject: [PATCH] mm/mmap.c: Remove redundant vma looping
Date: Sun, 4 Oct 2015 03:38:48 +0800	[thread overview]
Message-ID: <COL130-W38E921DBAB9CFCFCC45F73B94A0@phx.gbl> (raw)

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

>From 36dbcc145819655682f80efd49e72b01515b4e9a Mon Sep 17 00:00:00 2001
From: Chen Gang <gang.chen.5i5j@gmail.com>
Date: Sun, 4 Oct 2015 03:22:41 +0800
Subject: [PATCH] mm/mmap.c: Remove redundant vma looping

vma->vm_file->f_mapping and vma->anon_vma are shared with the same vma
looping, so merge them.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 mm/mmap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 8393580..f7c1631 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3201,9 +3201,7 @@ int mm_take_all_locks(struct mm_struct *mm)
 			goto out_unlock;
 		if (vma->vm_file && vma->vm_file->f_mapping)
 			vm_lock_mapping(mm, vma->vm_file->f_mapping);
-	}
 
-	for (vma = mm->mmap; vma; vma = vma->vm_next) {
 		if (signal_pending(current))
 			goto out_unlock;
 		if (vma->anon_vma)
-- 
1.9.3


Chen Gang

Open, share, and attitude like air, water, and life which God blessed
 		 	   		  

[-- Attachment #2: 0001-mm-mmap.c-Remove-redundant-vma-looping.patch --]
[-- Type: application/octet-stream, Size: 836 bytes --]

From 36dbcc145819655682f80efd49e72b01515b4e9a Mon Sep 17 00:00:00 2001
From: Chen Gang <gang.chen.5i5j@gmail.com>
Date: Sun, 4 Oct 2015 03:22:41 +0800
Subject: [PATCH] mm/mmap.c: Remove redundant vma looping

vma->vm_file->f_mapping and vma->anon_vma are shared with the same vma
looping, so merge them.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 mm/mmap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 8393580..f7c1631 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3201,9 +3201,7 @@ int mm_take_all_locks(struct mm_struct *mm)
 			goto out_unlock;
 		if (vma->vm_file && vma->vm_file->f_mapping)
 			vm_lock_mapping(mm, vma->vm_file->f_mapping);
-	}
 
-	for (vma = mm->mmap; vma; vma = vma->vm_next) {
 		if (signal_pending(current))
 			goto out_unlock;
 		if (vma->anon_vma)
-- 
1.9.3


             reply	other threads:[~2015-10-03 19:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03 19:38 Chen Gang [this message]
2015-10-03 20:09 ` Richard Weinberger
2015-10-04  4:55   ` Chen Gang
2015-10-04 17:26     ` Andrea Arcangeli
2015-10-05 12:23       ` Chen Gang

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=COL130-W38E921DBAB9CFCFCC45F73B94A0@phx.gbl \
    --to=xili_gchen_5257@hotmail.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=asha.levin@oracle.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=oleg@redhat.com \
    --cc=pfeiner@google.com \
    --cc=riel@redhat.com \
    --cc=vishnu.ps@samsung.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