Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762813Ab3ECIh6 (ORCPT ); Fri, 3 May 2013 04:37:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50538 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762526Ab3ECIhz (ORCPT ); Fri, 3 May 2013 04:37:55 -0400 Date: Fri, 3 May 2013 09:37:49 +0100 From: Mel Gorman To: Jan Kara 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 Subject: Re: [PATCH 1/3] mm: pagevec: Defer deciding what LRU to add a page to until pagevec drain time 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 Content-Disposition: inline In-Reply-To: <20130503075158.GB10633@quack.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1590 Lines: 40 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 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/