[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080701163601.37FB.KOSAKI.MOTOHIRO@jp.fujitsu.com>
Date: Tue, 01 Jul 2008 16:56:25 +0900
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: "MinChan Kim" <minchan.kim@...il.com>
Cc: kosaki.motohiro@...fujitsu.com,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>, "Rik van Riel" <riel@...hat.com>,
"Lee Schermerhorn" <Lee.Schermerhorn@...com>
Subject: Re: [PATCH -mm] split_lru: fix pagevec_move_tail() doesn't treat unevictable page
Hi Kim-san,
Thank you for good question.
> > even under writebacking, page can move to unevictable list.
> > so shouldn't pagevec_move_tail() check unevictable?
> >
> Hi, Kosaki-san.
>
> I can't understand this race situation.
> How the page can move to unevictable list while it is under writeback?
>
> Could you explain for me ? :)
Actually, I added below assertion and tested on stress workload.
then system crashed after 4H runnings.
----------------------------------------------
static void pagevec_move_tail(struct pagevec *pvec)
{
(snip)
if (PageLRU(page) && !PageActive(page)) {
int lru = page_is_file_cache(page);
list_move_tail(&page->lru, &zone->lru[lru].list);
BUG_ON(page_lru(page) != lru); // !!here
pgmoved++;
}
}
----------------------------------------------------
So, I guess below race exist (but I hope Rik's review)
CPU1 CPU2
==================================================================
1. rotate_reclaimable_page()
2. PageUnevictable(page) return 0
3. local_irq_save()
4. pagevec_move_tail()
SetPageUnevictable() //mlock?
move to unevictable list
5. spin_lock(&zone->lru_lock);
6. list_move_tail(); (move to inactive list)
then page have PageUnevictable() and is chained inactive lru.
Or, I misunderstand it?
abstraction of related function
------------------------------------------------------------
void rotate_reclaimable_page(struct page *page)
{
if (!PageLocked(page) && !PageDirty(page) && !PageActive(page) &&
!PageUnevictable(page) && PageLRU(page)) {
local_irq_save(flags);
pagevec_move_tail(pvec);
local_irq_restore(flags);
}
}
pagevec_move_tail(){
spin_lock(&zone->lru_lock);
if (PageLRU(page) && !PageActive(page)) {
list_move_tail(&page->lru, &zone->lru[lru].list);
}
spin_unlock(&zone->lru_lock);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists