From: Mel Gorman Subject: Re: [PATCH 1/3] mm: pagevec: Defer deciding what LRU to add a page to until pagevec drain time Date: Fri, 3 May 2013 09:37:49 +0100 Message-ID: <20130503083749.GL11497@suse.de> References: <1367253119-6461-1-git-send-email-mgorman@suse.de> <1367253119-6461-2-git-send-email-mgorman@suse.de> <20130503075158.GB10633@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Cc: Alexey Lyahkov , Andrew Perepechko , Robin Dong , Theodore Tso , Andrew Morton , Hugh Dickins , Rik van Riel , Johannes Weiner , Bernd Schubert , David Howells , Trond Myklebust , Linux-fsdevel , Linux-ext4 , LKML , Linux-mm To: Jan Kara Return-path: Content-Disposition: inline In-Reply-To: <20130503075158.GB10633@quack.suse.cz> Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org On Fri, May 03, 2013 at 09:51:58AM +0200, Jan Kara wrote: > > @@ -789,17 +787,16 @@ void lru_add_page_tail(struct page *page, struct page *page_tail, > > static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec, > > void *arg) > > { > > - enum lru_list lru = (enum lru_list)arg; > > - int file = is_file_lru(lru); > > - int active = is_active_lru(lru); > > + enum lru_list requested_lru = (enum lru_list)arg; > > + int file = page_is_file_cache(page); > > + int active = PageActive(page); > > + enum lru_list lru = page_lru(page); > > > > - VM_BUG_ON(PageActive(page)); > > + WARN_ON_ONCE(requested_lru < NR_LRU_LISTS && requested_lru != lru); > Hum, so __lru_cache_add() calls this with 'requested_lru' set to whatever > LRU we currently want to add a page. How should this always be equal to the > LRU of all the pages we have cached in the pagevec? > It wouldn't necessarily be and and for a pagevec drain, it's ignored completely. > And if I'm right, there doesn't seem to be a reason to pass requested_lru > to this function at all, does it? > You've already noticed that it gets thrown away later in the third patch. It was left in this patch as a debugging aid in case there was a direct pagevec user that expected to place pages on an LRU that was at odds with the page flags. -- Mel Gorman SUSE Labs -- 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