Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756492AbZCVUPA (ORCPT ); Sun, 22 Mar 2009 16:15:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755122AbZCVUOQ (ORCPT ); Sun, 22 Mar 2009 16:14:16 -0400 Received: from cmpxchg.org ([85.214.51.133]:52657 "EHLO cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753102AbZCVUOO (ORCPT ); Sun, 22 Mar 2009 16:14:14 -0400 From: Johannes Weiner To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Howells , Nick Piggin , KOSAKI Motohiro , Rik van Riel , Peter Zijlstra , MinChan Kim , Lee Schermerhorn Subject: [patch 3/3] mm: keep pages from unevictable mappings off the LRU lists Date: Sun, 22 Mar 2009 21:13:04 +0100 Message-Id: <1237752784-1989-3-git-send-email-hannes@cmpxchg.org> X-Mailer: git-send-email 1.6.2.1.135.gde769 In-Reply-To: <20090321102044.GA3427@cmpxchg.org> References: <20090321102044.GA3427@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1597 Lines: 44 Check if the mapping is evictable when initially adding page cache pages to the LRU lists. If that is not the case, add them to the unevictable list immediately instead of leaving it up to the reclaim code to move them there. This is useful for ramfs and locked shmem which mark whole mappings as unevictable and we know at fault time already that it is useless to try reclaiming these pages. Signed-off-by: Johannes Weiner Cc: David Howells Cc: Nick Piggin Cc: KOSAKI Motohiro Cc: Rik van Riel Cc: Peter Zijlstra Cc: MinChan Kim Cc: Lee Schermerhorn --- mm/filemap.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 23acefe..8574530 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -506,7 +506,9 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping, ret = add_to_page_cache(page, mapping, offset, gfp_mask); if (ret == 0) { - if (page_is_file_cache(page)) + if (mapping_unevictable(mapping)) + add_page_to_unevictable_list(page); + else if (page_is_file_cache(page)) lru_cache_add_file(page); else lru_cache_add_active_anon(page); -- 1.6.2.1.135.gde769 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/