lkml.org 
[lkml]   [2008]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] putback_lru_page()/unevictable page handling rework v3

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().





\
 
 \ /
  Last update: 2008-06-24 11:53    [W:0.077 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site