From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail138.messagelabs.com (mail138.messagelabs.com [216.82.249.35]) by kanga.kvack.org (Postfix) with ESMTP id 2E8336B01B1 for ; Thu, 20 May 2010 21:31:58 -0400 (EDT) Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id o4L1VqqV031383 for ; Thu, 20 May 2010 18:31:53 -0700 Received: from pvc22 (pvc22.prod.google.com [10.241.209.150]) by wpaz5.hot.corp.google.com with ESMTP id o4L1VpH9014580 for ; Thu, 20 May 2010 18:31:51 -0700 Received: by pvc22 with SMTP id 22so239031pvc.24 for ; Thu, 20 May 2010 18:31:51 -0700 (PDT) Date: Thu, 20 May 2010 18:31:30 -0700 (PDT) From: Hugh Dickins Subject: Re: [PATCH] tmpfs: Insert tmpfs cache pages to inactive list at first In-Reply-To: <20100519174327.9591.A69D9226@jp.fujitsu.com> Message-ID: References: <20100519174327.9591.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: KOSAKI Motohiro Cc: Shaohua Li , Wu Fengguang , Johannes Weiner , Rik van Riel , Minchan Kim , LKML , linux-mm , Andrew Morton List-ID: On Wed, 19 May 2010, KOSAKI Motohiro wrote: > Shaohua Li reported parallel file copy on tmpfs can lead to > OOM killer. This is regression of caused by commit 9ff473b9a7 > (vmscan: evict streaming IO first). Wow, It is 2 years old patch! > > Currently, tmpfs file cache is inserted active list at first. It > mean the insertion doesn't only increase numbers of pages in anon LRU, > but also reduce anon scanning ratio. Therefore, vmscan will get totally > confusion. It scan almost only file LRU even though the system have > plenty unused tmpfs pages. > > Historically, lru_cache_add_active_anon() was used by two reasons. > 1) Intend to priotize shmem page rather than regular file cache. > 2) Intend to avoid reclaim priority inversion of used once pages. > > But we've lost both motivation because (1) Now we have separate > anon and file LRU list. then, to insert active list doesn't help > such priotize. (2) In past, one pte access bit will cause page > activation. then to insert inactive list with pte access bit mean > higher priority than to insert active list. Its priority inversion > may lead to uninteded lru chun. but it was already solved by commit > 645747462 (vmscan: detect mapped file pages used only once). > (Thanks Hannes, you are great!) > > Thus, now we can use lru_cache_add_anon() instead. > > Reported-by: Shaohua Li > Cc: Wu Fengguang > Cc: Johannes Weiner > Cc: Rik van Riel > Cc: Minchan Kim > Cc: Hugh Dickins > Signed-off-by: KOSAKI Motohiro Acked-by: Hugh Dickins Thanks - though I don't quite agree with your description: I can't see why the lru_cache_add_active_anon() was ever justified - that "active" came in along with the separate anon and file LRU lists. Hugh -- 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