From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by kanga.kvack.org (Postfix) with ESMTP id D12966B0069 for ; Fri, 3 Oct 2014 12:07:02 -0400 (EDT) Received: by mail-wi0-f172.google.com with SMTP id n3so7681434wiv.5 for ; Fri, 03 Oct 2014 09:07:02 -0700 (PDT) Received: from mx2.suse.de (cantor2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id m6si2483710wiy.107.2014.10.03.09.07.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 09:07:01 -0700 (PDT) From: Michal Hocko Subject: [PATCH] mm-memcontrol-do-not-kill-uncharge-batching-in-free_pages_and_swap_cache-fix.patch Date: Fri, 3 Oct 2014 18:06:50 +0200 Message-Id: <1412352410-23500-1-git-send-email-mhocko@suse.cz> In-Reply-To: <20141002155750.GB2035@cmpxchg.org> References: <20141002155750.GB2035@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Johannes Weiner , Greg Thelen , Vladimir Davydov , Dave Hansen , linux-mm@kvack.org, LKML count all pages because many pages might be off LRU already. Signed-off-by: Michal Hocko --- mm/swap.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index 39affa1932ce..8a12b33936b4 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -911,13 +911,22 @@ void release_pages(struct page **pages, int nr, bool cold) 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, int nr, bool cold) 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 */ -- 2.1.1 -- 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: email@kvack.org