Commit b3966101 authored by Hugh Dickins's avatar Hugh Dickins Committed by James Toy

My usual tmpfs swapping loads on recent mmotms have oddly aroused the OOM

killer after an hour or two.  Bisection led to
mm-return-boolean-from-page_is_file_cache.patch, but really it's the prior
mm-introduce-page_lru_base_type.patch that's at fault.

It converted page_lru() to use page_lru_base_type(), but forgot to convert
del_page_from_lru() - which then decremented the wrong stats once
page_is_file_cache() was changed to a boolean.

Fix that, move page_lru_base_type() before del_page_from_lru(), and mark
it "inline" like the other mm_inline.h functions.
Signed-off-by: default avatarHugh Dickins <hugh.dickins@tiscali.co.uk>
Reviewed-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: default avatarRik van Riel <riel@redhat.com>
Reviewed-by: default avatarMinchan Kim <minchan.kim@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 963a52e9
......@@ -39,41 +39,41 @@ del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l)
mem_cgroup_del_lru_list(page, l);
}
/**
* page_lru_base_type - which LRU list type should a page be on?
* @page: the page to test
*
* Used for LRU list index arithmetic.
*
* Returns the base LRU type - file or anon - @page should be on.
*/
static inline enum lru_list page_lru_base_type(struct page *page)
{
if (page_is_file_cache(page))
return LRU_INACTIVE_FILE;
return LRU_INACTIVE_ANON;
}
static inline void
del_page_from_lru(struct zone *zone, struct page *page)
{
enum lru_list l = LRU_BASE;
enum lru_list l;
list_del(&page->lru);
if (PageUnevictable(page)) {
__ClearPageUnevictable(page);
l = LRU_UNEVICTABLE;
} else {
l = page_lru_base_type(page);
if (PageActive(page)) {
__ClearPageActive(page);
l += LRU_ACTIVE;
}
l += page_is_file_cache(page);
}
__dec_zone_state(zone, NR_LRU_BASE + l);
mem_cgroup_del_lru_list(page, l);
}
/**
* page_lru_base_type - which LRU list type should a page be on?
* @page: the page to test
*
* Used for LRU list index arithmetic.
*
* Returns the base LRU type - file or anon - @page should be on.
*/
static enum lru_list page_lru_base_type(struct page *page)
{
if (page_is_file_cache(page))
return LRU_INACTIVE_FILE;
return LRU_INACTIVE_ANON;
}
/**
* page_lru - which LRU list should a page be on?
* @page: the page to test
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment