From: <zhouxianrong@huawei.com>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
rientjes@google.com, hannes@cmpxchg.org,
chris@chris-wilson.co.uk, vdavydov.dev@gmail.com,
mgorman@techsingularity.net, joe@perches.com,
shawn.lin@rock-chips.com, iamjoonsoo.kim@lge.com,
kuleshovmail@gmail.com, zhouxianrong@huawei.com,
zhouxiyu@huawei.com, zhangshiming5@huawei.com,
won.ho.park@huawei.com, tuxiaobing@huawei.com
Subject: [PATCH vmalloc] reduce purge_lock range and hold time of vmap_area_lock
Date: Tue, 18 Oct 2016 10:25:21 +0800 [thread overview]
Message-ID: <1476757521-3262-1-git-send-email-zhouxianrong@huawei.com> (raw)
In-Reply-To: <1476540769-31893-1-git-send-email-zhouxianrong@huawei.com>
From: z00281421 <z00281421@notesmail.huawei.com>
Signed-off-by: z00281421 <z00281421@notesmail.huawei.com>
---
mm/vmalloc.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 91f44e7..e9c9c04 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -661,13 +661,18 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
if (nr || force_flush)
flush_tlb_kernel_range(*start, *end);
+ spin_unlock(&purge_lock);
+
if (nr) {
+ unsigned char batch = 0;
spin_lock(&vmap_area_lock);
- llist_for_each_entry_safe(va, n_va, valist, purge_list)
+ llist_for_each_entry_safe(va, n_va, valist, purge_list) {
__free_vmap_area(va);
+ if (!batch++)
+ cond_resched_lock(&vmap_area_lock);
+ }
spin_unlock(&vmap_area_lock);
}
- spin_unlock(&purge_lock);
}
/*
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2016-10-18 2:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-15 14:12 [PATCH vmalloc] reduce purge_lock range and hold time of zhouxianrong
2016-10-15 16:55 ` Christoph Hellwig
2016-10-18 2:55 ` zhouxianrong
2016-10-18 2:25 ` zhouxianrong [this message]
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=1476757521-3262-1-git-send-email-zhouxianrong@huawei.com \
--to=zhouxianrong@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=chris@chris-wilson.co.uk \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=joe@perches.com \
--cc=kuleshovmail@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=rientjes@google.com \
--cc=shawn.lin@rock-chips.com \
--cc=tuxiaobing@huawei.com \
--cc=vdavydov.dev@gmail.com \
--cc=won.ho.park@huawei.com \
--cc=zhangshiming5@huawei.com \
--cc=zhouxiyu@huawei.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).