From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: "MinChan Kim" <minchan.kim@gmail.com>
Cc: kosaki.motohiro@jp.fujitsu.com,
LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>, "Rik van Riel" <riel@redhat.com>,
"Lee Schermerhorn" <Lee.Schermerhorn@hp.com>
Subject: Re: [PATCH -mm] split_lru: fix pagevec_move_tail() doesn't treat unevictable page
Date: Tue, 01 Jul 2008 16:56:25 +0900 [thread overview]
Message-ID: <20080701163601.37FB.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <28c262360807010034m7438f1e3yc28daae9978150b6@mail.gmail.com>
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);
}
next prev parent reply other threads:[~2008-07-01 7:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 7:01 KOSAKI Motohiro
2008-07-01 7:34 ` MinChan Kim
2008-07-01 7:56 ` KOSAKI Motohiro [this message]
2008-07-01 8:16 ` MinChan Kim
2008-07-01 8:26 ` [resend][PATCH " KOSAKI Motohiro
2008-07-01 13:38 ` Rik van Riel
2008-07-02 0:39 ` MinChan Kim
2008-07-02 0:49 ` MinChan Kim
2008-07-02 0:54 ` MinChan Kim
2008-07-02 3:30 ` KOSAKI Motohiro
2008-07-02 5:00 ` MinChan Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080701163601.37FB.KOSAKI.MOTOHIRO@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=Lee.Schermerhorn@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=riel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®