From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 8 Feb 2007 13:19:37 -0800 (PST) From: Christoph Lameter Subject: Re: Drop PageReclaim() In-Reply-To: <20070207092517.15071f04.akpm@linux-foundation.org> Message-ID: References: <20070207092517.15071f04.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Andrew Morton Cc: linux-mm@kvack.org List-ID: On Wed, 7 Feb 2007, Andrew Morton wrote: > On Wed, 7 Feb 2007 06:13:48 -0800 (PST) Christoph Lameter wrote: > > > Am I missing something here? I cannot see PageReclaim have any effect? > > > > > > > > PageReclaim is only used for dead code. The only current user is > > end_page_writeback() which has the following lines: > > > > if (!TestClearPageReclaim(page) || rotate_reclaimable_page(page)) { > > if (!test_clear_page_writeback(page)) > > BUG(); > > } > > > > So the if statement is performed if !PageReclaim(page). > > If PageReclaim is set then we call rorate_reclaimable(page) which > > does: > > > > if (!PageLRU(page)) > > return 1; > > > > The only user of PageReclaim is shrink_list(). The pages processed > > by shrink_list have earlier been taken off the LRU. So !PageLRU is always > > true. > > > > The if statement is therefore always true and the rotating code > > is never executed. > > end_page_writeback() is amazingly obscure for such a short function. For > which I apologise, but on revisit, it's still not obvious how to clean it > up. > > It does: > > if (!PageReclaim(page)) { > clear_page_writeback(); Well it does if (!test_clear_page_writeback(page)) BUG(); > if (PageRecaim(page)) { > ClearPageReclaim(page); > foo = rotate_reclaimable_page(page); PageReclaim is only used while the page is off the LRU. In that case rotate_reclaimable_page is always returning 1. So foo = 1 and rotate_reclaimable_page is useless. > if (foo == 0) { > /* > * rotate_reclaimable_page has already done > * clear_page_writeback() > */ > } else { > clear_page_writeback(page); This is also a test_clear ... -- 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