* [PATCH mmotm] mm: introduce page_lru_base_type fix
@ 2009-08-26 9:53 ` Hugh Dickins
0 siblings, 0 replies; 10+ messages in thread
From: Hugh Dickins @ 2009-08-26 9:53 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Rik van Riel, Minchan Kim, KOSAKI Motohiro,
linux-kernel, linux-mm
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: Hugh Dickins <hugh.dickins@tiscali.co.uk>
---
include/linux/mm_inline.h | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
--- mmotm/include/linux/mm_inline.h 2009-08-21 12:12:42.000000000 +0100
+++ linux/include/linux/mm_inline.h 2009-08-26 00:39:38.000000000 +0100
@@ -35,42 +35,42 @@ del_page_from_lru_list(struct zone *zone
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
*
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH mmotm] mm: introduce page_lru_base_type fix
@ 2009-08-26 9:53 ` Hugh Dickins
0 siblings, 0 replies; 10+ messages in thread
From: Hugh Dickins @ 2009-08-26 9:53 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Rik van Riel, Minchan Kim, KOSAKI Motohiro,
linux-kernel, linux-mm
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: Hugh Dickins <hugh.dickins@tiscali.co.uk>
---
include/linux/mm_inline.h | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
--- mmotm/include/linux/mm_inline.h 2009-08-21 12:12:42.000000000 +0100
+++ linux/include/linux/mm_inline.h 2009-08-26 00:39:38.000000000 +0100
@@ -35,42 +35,42 @@ del_page_from_lru_list(struct zone *zone
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
*
--
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>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH mmotm] mm: introduce page_lru_base_type fix
2009-08-26 9:53 ` Hugh Dickins
@ 2009-08-26 10:17 ` KOSAKI Motohiro
-1 siblings, 0 replies; 10+ messages in thread
From: KOSAKI Motohiro @ 2009-08-26 10:17 UTC (permalink / raw)
To: Hugh Dickins
Cc: kosaki.motohiro, Andrew Morton, Johannes Weiner, Rik van Riel,
Minchan Kim, linux-kernel, linux-mm
> 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: Hugh Dickins <hugh.dickins@tiscali.co.uk>
I'm sorry vmscan related patch bother you.
this is definitely right fix, thak you.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
>
> include/linux/mm_inline.h | 34 +++++++++++++++++-----------------
> 1 file changed, 17 insertions(+), 17 deletions(-)
>
> --- mmotm/include/linux/mm_inline.h 2009-08-21 12:12:42.000000000 +0100
> +++ linux/include/linux/mm_inline.h 2009-08-26 00:39:38.000000000 +0100
> @@ -35,42 +35,42 @@ del_page_from_lru_list(struct zone *zone
> 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
> *
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH mmotm] mm: introduce page_lru_base_type fix
@ 2009-08-26 10:17 ` KOSAKI Motohiro
0 siblings, 0 replies; 10+ messages in thread
From: KOSAKI Motohiro @ 2009-08-26 10:17 UTC (permalink / raw)
To: Hugh Dickins
Cc: kosaki.motohiro, Andrew Morton, Johannes Weiner, Rik van Riel,
Minchan Kim, linux-kernel, linux-mm
> 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: Hugh Dickins <hugh.dickins@tiscali.co.uk>
I'm sorry vmscan related patch bother you.
this is definitely right fix, thak you.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
>
> include/linux/mm_inline.h | 34 +++++++++++++++++-----------------
> 1 file changed, 17 insertions(+), 17 deletions(-)
>
> --- mmotm/include/linux/mm_inline.h 2009-08-21 12:12:42.000000000 +0100
> +++ linux/include/linux/mm_inline.h 2009-08-26 00:39:38.000000000 +0100
> @@ -35,42 +35,42 @@ del_page_from_lru_list(struct zone *zone
> 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
> *
--
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>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH mmotm] mm: introduce page_lru_base_type fix
2009-08-26 9:53 ` Hugh Dickins
@ 2009-08-26 10:33 ` Johannes Weiner
-1 siblings, 0 replies; 10+ messages in thread
From: Johannes Weiner @ 2009-08-26 10:33 UTC (permalink / raw)
To: Hugh Dickins
Cc: Andrew Morton, Rik van Riel, Minchan Kim, KOSAKI Motohiro,
linux-kernel, linux-mm
On Wed, Aug 26, 2009 at 10:53:47AM +0100, Hugh Dickins wrote:
> 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.
Ouch, sorry. Thanks for your fix.
> Fix that, move page_lru_base_type() before del_page_from_lru(),
> and mark it "inline" like the other mm_inline.h functions.
Hannes
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH mmotm] mm: introduce page_lru_base_type fix
@ 2009-08-26 10:33 ` Johannes Weiner
0 siblings, 0 replies; 10+ messages in thread
From: Johannes Weiner @ 2009-08-26 10:33 UTC (permalink / raw)
To: Hugh Dickins
Cc: Andrew Morton, Rik van Riel, Minchan Kim, KOSAKI Motohiro,
linux-kernel, linux-mm
On Wed, Aug 26, 2009 at 10:53:47AM +0100, Hugh Dickins wrote:
> 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.
Ouch, sorry. Thanks for your fix.
> Fix that, move page_lru_base_type() before del_page_from_lru(),
> and mark it "inline" like the other mm_inline.h functions.
Hannes
--
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>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH mmotm] mm: introduce page_lru_base_type fix
2009-08-26 9:53 ` Hugh Dickins
@ 2009-08-26 14:36 ` Rik van Riel
-1 siblings, 0 replies; 10+ messages in thread
From: Rik van Riel @ 2009-08-26 14:36 UTC (permalink / raw)
To: Hugh Dickins
Cc: Andrew Morton, Johannes Weiner, Minchan Kim, KOSAKI Motohiro,
linux-kernel, linux-mm
Hugh Dickins wrote:
> 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: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Reviewed-by: Rik van Riel <riel@redhat.com>
--
All rights reversed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH mmotm] mm: introduce page_lru_base_type fix
@ 2009-08-26 14:36 ` Rik van Riel
0 siblings, 0 replies; 10+ messages in thread
From: Rik van Riel @ 2009-08-26 14:36 UTC (permalink / raw)
To: Hugh Dickins
Cc: Andrew Morton, Johannes Weiner, Minchan Kim, KOSAKI Motohiro,
linux-kernel, linux-mm
Hugh Dickins wrote:
> 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: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Reviewed-by: Rik van Riel <riel@redhat.com>
--
All rights reversed.
--
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>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH mmotm] mm: introduce page_lru_base_type fix
2009-08-26 9:53 ` Hugh Dickins
@ 2009-08-26 23:20 ` Minchan Kim
-1 siblings, 0 replies; 10+ messages in thread
From: Minchan Kim @ 2009-08-26 23:20 UTC (permalink / raw)
To: Hugh Dickins
Cc: Andrew Morton, Johannes Weiner, Rik van Riel, KOSAKI Motohiro,
linux-kernel, linux-mm
On Wed, Aug 26, 2009 at 6:53 PM, Hugh Dickins<hugh.dickins@tiscali.co.uk> wrote:
> 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: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
--
Kind regards,
Minchan Kim
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH mmotm] mm: introduce page_lru_base_type fix
@ 2009-08-26 23:20 ` Minchan Kim
0 siblings, 0 replies; 10+ messages in thread
From: Minchan Kim @ 2009-08-26 23:20 UTC (permalink / raw)
To: Hugh Dickins
Cc: Andrew Morton, Johannes Weiner, Rik van Riel, KOSAKI Motohiro,
linux-kernel, linux-mm
On Wed, Aug 26, 2009 at 6:53 PM, Hugh Dickins<hugh.dickins@tiscali.co.uk> wrote:
> 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: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
--
Kind regards,
Minchan Kim
--
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>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-08-26 23:26 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-26 9:53 [PATCH mmotm] mm: introduce page_lru_base_type fix Hugh Dickins
2009-08-26 9:53 ` Hugh Dickins
2009-08-26 10:17 ` KOSAKI Motohiro
2009-08-26 10:17 ` KOSAKI Motohiro
2009-08-26 10:33 ` Johannes Weiner
2009-08-26 10:33 ` Johannes Weiner
2009-08-26 14:36 ` Rik van Riel
2009-08-26 14:36 ` Rik van Riel
2009-08-26 23:20 ` Minchan Kim
2009-08-26 23:20 ` Minchan Kim
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.