[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1476757521-3262-1-git-send-email-zhouxianrong@huawei.com>
Date: Tue, 18 Oct 2016 10:25:21 +0800
From: <zhouxianrong@...wei.com>
To: <linux-mm@...ck.org>
CC: <linux-kernel@...r.kernel.org>, <akpm@...ux-foundation.org>,
<rientjes@...gle.com>, <hannes@...xchg.org>,
<chris@...is-wilson.co.uk>, <vdavydov.dev@...il.com>,
<mgorman@...hsingularity.net>, <joe@...ches.com>,
<shawn.lin@...k-chips.com>, <iamjoonsoo.kim@....com>,
<kuleshovmail@...il.com>, <zhouxianrong@...wei.com>,
<zhouxiyu@...wei.com>, <zhangshiming5@...wei.com>,
<won.ho.park@...wei.com>, <tuxiaobing@...wei.com>
Subject: [PATCH vmalloc] reduce purge_lock range and hold time of vmap_area_lock
From: z00281421 <z00281421@...esmail.huawei.com>
Signed-off-by: z00281421 <z00281421@...esmail.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
Powered by blists - more mailing lists