The patch titled Subject: mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix has been added to the -mm tree. Its filename is mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix.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: Michal Hocko <mhocko@xxxxxxx> Subject: mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix count all pages because many pages might be off LRU already. Signed-off-by: Michal Hocko <mhocko@xxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Dave Hansen <dave@xxxxxxxx> Cc: Vladimir Davydov <vdavydov@xxxxxxxxxxxxx> Cc: Greg Thelen <gthelen@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/swap.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff -puN mm/swap.c~mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix mm/swap.c --- a/mm/swap.c~mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix +++ a/mm/swap.c @@ -911,13 +911,22 @@ void release_pages(struct page **pages, if (unlikely(PageCompound(page))) { if (zone) { spin_unlock_irqrestore(&zone->lru_lock, flags); - lock_batch = 0; zone = NULL; } put_compound_page(page); continue; } + /* + * Make sure the IRQ-safe lock-holding time does not get + * excessive with a continuous string of pages from the + * same zone. The lock is held only if zone != NULL. + */ + if (zone && ++lock_batch == SWAP_CLUSTER_MAX) { + spin_unlock_irqrestore(&zone->lru_lock, flags); + zone = NULL; + } + if (!put_page_testzero(page)) continue; @@ -937,16 +946,6 @@ void release_pages(struct page **pages, VM_BUG_ON_PAGE(!PageLRU(page), page); __ClearPageLRU(page); del_page_from_lru_list(page, lruvec, page_off_lru(page)); - - /* - * Make sure the IRQ-safe lock-holding time - * does not get excessive with a continuous - * string of pages from the same zone. - */ - if (++lock_batch == SWAP_CLUSTER_MAX) { - spin_unlock_irqrestore(&zone->lru_lock, flags); - zone = NULL; - } } /* Clear Active bit in case of parallel mark_page_accessed */ _ Patches currently in -mm which might be from mhocko@xxxxxxx are origin.patch introduce-dump_vma.patch introduce-dump_vma-fix.patch introduce-vm_bug_on_vma.patch convert-a-few-vm_bug_on-callers-to-vm_bug_on_vma.patch mm-debug-mm-introduce-vm_bug_on_mm-fixpatch.patch mm-debug-mm-introduce-vm_bug_on_mm-fix-fixpatch.patch mm-debug-mm-introduce-vm_bug_on_mm-fix-fixpatch-fix.patch memcg-move-memcg_allocfree_cache_params-to-slab_commonc.patch memcg-dont-call-memcg_update_all_caches-if-new-cache-id-fits.patch memcg-move-memcg_update_cache_size-to-slab_commonc.patch mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache.patch mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix.patch mm-memcontrol-simplify-detecting-when-the-memoryswap-limit-is-hit.patch mm-memcontrol-fix-transparent-huge-page-allocations-under-pressure.patch memcg-zap-memcg_can_account_kmem.patch linux-next.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