The patch titled Subject: mm/vmalloc.c: reduce purge_lock range and hold time of vmap_area_lock has been added to the -mm tree. Its filename is reduce-purge_lock-range-and-hold-time-of-vmap_area_lock.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/reduce-purge_lock-range-and-hold-time-of-vmap_area_lock.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/reduce-purge_lock-range-and-hold-time-of-vmap_area_lock.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: z00281421 <z00281421@xxxxxxxxxxxxxxxxxxxx> Subject: mm/vmalloc.c: reduce purge_lock range and hold time of vmap_area_lock Link: http://lkml.kernel.org/r/1476757521-3262-1-git-send-email-zhouxianrong@xxxxxxxxxx Signed-off-by: z00281421 <z00281421@xxxxxxxxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: Vladimir Davydov <vdavydov.dev@xxxxxxxxx> Cc: Joe Perches <joe@xxxxxxxxxxx> Cc: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Alexander Kuleshov <kuleshovmail@xxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmalloc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff -puN mm/vmalloc.c~reduce-purge_lock-range-and-hold-time-of-vmap_area_lock mm/vmalloc.c --- a/mm/vmalloc.c~reduce-purge_lock-range-and-hold-time-of-vmap_area_lock +++ a/mm/vmalloc.c @@ -661,13 +661,18 @@ static void __purge_vmap_area_lazy(unsig 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); } /* _ Patches currently in -mm which might be from z00281421@xxxxxxxxxxxxxxxxxxxx are reduce-purge_lock-range-and-hold-time-of-vmap_area_lock.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html