All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Rik van Riel <riel@redhat.com>
Subject: Re: [RFC][PATCH] putback_lru_page()/unevictable page handling rework v3
Date: Tue, 24 Jun 2008 13:15:41 -0400	[thread overview]
Message-ID: <1214327741.6563.17.camel@lts-notebook> (raw)
In-Reply-To: <20080624184122.D838.KOSAKI.MOTOHIRO@jp.fujitsu.com>

On Tue, 2008-06-24 at 18:49 +0900, KOSAKI Motohiro wrote:
> I found one bug ;)
> 
> > -int putback_lru_page(struct page *page)
> > +#ifdef CONFIG_UNEVICTABLE_LRU
> > +void putback_lru_page(struct page *page)
> >  {
> >  	int lru;
> > -	int ret = 1;
> >  	int was_unevictable;
> >  
> > -	VM_BUG_ON(!PageLocked(page));
> >  	VM_BUG_ON(PageLRU(page));
> >  
> > +	was_unevictable = TestClearPageUnevictable(page);
> > +
> > +redo:
> >  	lru = !!TestClearPageActive(page);
> > -	was_unevictable = TestClearPageUnevictable(page); /* for page_evictable() */
> 
> (snip)
> 
> > +	mem_cgroup_move_lists(page, lru);
> > +
> > +	/*
> > +	 * page's status can change while we move it among lru. If an evictable
> > +	 * page is on unevictable list, it never be freed. To avoid that,
> > +	 * check after we added it to the list, again.
> > +	 */
> > +	if (lru == LRU_UNEVICTABLE && page_evictable(page, NULL)) {
> > +		if (!isolate_lru_page(page)) {
> > +			put_page(page);
> > +			goto redo;
> 
> at this point, We should call ClearPageUnevictable().
> otherwise, BUG() is called on isolate_lru_pages().
> 

To which BUG() are you referring here?  There used to be a
BUG_ON(PageUnevictable(page)) in page_evictable(), but Kame-san removed
that.

By the wah, we'll never take the retry because 'lru' never ==
LRU_UNEVICTABLE in this version of putback_lru_page().  Patch to follow.

Lee


WARNING: multiple messages have this Message-ID (diff)
From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Rik van Riel <riel@redhat.com>
Subject: Re: [RFC][PATCH] putback_lru_page()/unevictable page handling rework v3
Date: Tue, 24 Jun 2008 13:15:41 -0400	[thread overview]
Message-ID: <1214327741.6563.17.camel@lts-notebook> (raw)
In-Reply-To: <20080624184122.D838.KOSAKI.MOTOHIRO@jp.fujitsu.com>

On Tue, 2008-06-24 at 18:49 +0900, KOSAKI Motohiro wrote:
> I found one bug ;)
> 
> > -int putback_lru_page(struct page *page)
> > +#ifdef CONFIG_UNEVICTABLE_LRU
> > +void putback_lru_page(struct page *page)
> >  {
> >  	int lru;
> > -	int ret = 1;
> >  	int was_unevictable;
> >  
> > -	VM_BUG_ON(!PageLocked(page));
> >  	VM_BUG_ON(PageLRU(page));
> >  
> > +	was_unevictable = TestClearPageUnevictable(page);
> > +
> > +redo:
> >  	lru = !!TestClearPageActive(page);
> > -	was_unevictable = TestClearPageUnevictable(page); /* for page_evictable() */
> 
> (snip)
> 
> > +	mem_cgroup_move_lists(page, lru);
> > +
> > +	/*
> > +	 * page's status can change while we move it among lru. If an evictable
> > +	 * page is on unevictable list, it never be freed. To avoid that,
> > +	 * check after we added it to the list, again.
> > +	 */
> > +	if (lru == LRU_UNEVICTABLE && page_evictable(page, NULL)) {
> > +		if (!isolate_lru_page(page)) {
> > +			put_page(page);
> > +			goto redo;
> 
> at this point, We should call ClearPageUnevictable().
> otherwise, BUG() is called on isolate_lru_pages().
> 

To which BUG() are you referring here?  There used to be a
BUG_ON(PageUnevictable(page)) in page_evictable(), but Kame-san removed
that.

By the wah, we'll never take the retry because 'lru' never ==
LRU_UNEVICTABLE in this version of putback_lru_page().  Patch to follow.

Lee

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2008-06-24 17:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-21 10:00 [RFC][PATCH] putback_lru_page()/unevictable page handling rework v3 KOSAKI Motohiro
2008-06-21 10:00 ` KOSAKI Motohiro
2008-06-24  2:43 ` KOSAKI Motohiro
2008-06-24  2:43   ` KOSAKI Motohiro
2008-06-24 17:10   ` Lee Schermerhorn
2008-06-24 17:10     ` Lee Schermerhorn
2008-06-24 17:55     ` Andrew Morton
2008-06-24 17:55       ` Andrew Morton
2008-06-24 19:11       ` Lee Schermerhorn
2008-06-24 19:11         ` Lee Schermerhorn
2008-06-24 19:19         ` Andrew Morton
2008-06-24 19:19           ` Andrew Morton
2008-06-24 17:29   ` [PATCH] fix2 to " Lee Schermerhorn
2008-06-24 17:29     ` Lee Schermerhorn
2008-06-24 17:38     ` KOSAKI Motohiro
2008-06-24 17:38       ` KOSAKI Motohiro
2008-06-24  9:49 ` [RFC][PATCH] " KOSAKI Motohiro
2008-06-24  9:49   ` KOSAKI Motohiro
2008-06-24  9:59   ` KAMEZAWA Hiroyuki
2008-06-24  9:59     ` KAMEZAWA Hiroyuki
2008-06-24 17:15   ` Lee Schermerhorn [this message]
2008-06-24 17:15     ` Lee Schermerhorn
2008-06-24 17:19   ` [PATCH] fix to " Lee Schermerhorn
2008-06-24 17:19     ` Lee Schermerhorn
2008-06-24 17:35     ` KOSAKI Motohiro
2008-06-24 17:35       ` KOSAKI Motohiro
2008-06-24 17:48       ` Lee Schermerhorn
2008-06-24 17:48         ` Lee Schermerhorn
2008-06-24 18:19         ` KOSAKI Motohiro
2008-06-24 18:19           ` KOSAKI Motohiro

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=1214327741.6563.17.camel@lts-notebook \
    --to=lee.schermerhorn@hp.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.