From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753426Ab2LQSNt (ORCPT ); Mon, 17 Dec 2012 13:13:49 -0500 Received: from zene.cmpxchg.org ([85.214.230.12]:36579 "EHLO zene.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753067Ab2LQSNp (ORCPT ); Mon, 17 Dec 2012 13:13:45 -0500 From: Johannes Weiner To: Andrew Morton Cc: Rik van Riel , Michal Hocko , Mel Gorman , Hugh Dickins , Satoru Moriya , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [patch 4/7] mm: vmscan: improve comment on low-page cache handling Date: Mon, 17 Dec 2012 13:12:34 -0500 Message-Id: <1355767957-4913-5-git-send-email-hannes@cmpxchg.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1355767957-4913-1-git-send-email-hannes@cmpxchg.org> References: <1355767957-4913-1-git-send-email-hannes@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix comment style and elaborate on why anonymous memory is force-scanned when file cache runs low. Signed-off-by: Johannes Weiner Reviewed-by: Rik van Riel Acked-by: Mel Gorman Reviewed-by: Michal Hocko --- mm/vmscan.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index c37deaf..510c0d3 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1701,13 +1701,15 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, file = get_lru_size(lruvec, LRU_ACTIVE_FILE) + get_lru_size(lruvec, LRU_INACTIVE_FILE); + /* + * If it's foreseeable that reclaiming the file cache won't be + * enough to get the zone back into a desirable shape, we have + * to swap. Better start now and leave the - probably heavily + * thrashing - remaining file pages alone. + */ if (global_reclaim(sc)) { - free = zone_page_state(zone, NR_FREE_PAGES); + free = zone_page_state(zone, NR_FREE_PAGES); if (unlikely(file + free <= high_wmark_pages(zone))) { - /* - * If we have very few page cache pages, force-scan - * anon pages. - */ fraction[0] = 1; fraction[1] = 0; denominator = 1; -- 1.7.11.7