* [PATCH] mm: remove return value of putback_lru_pages
@ 2010-03-15 13:16 Minchan Kim
2010-03-15 13:40 ` Rik van Riel
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Minchan Kim @ 2010-03-15 13:16 UTC (permalink / raw)
To: Andrew Morton; +Cc: Rik van Riel, KOSAKI Motohiro, linux-kernel, linux-mm
Now putback_lru_page never can fail.
So it doesn't matter count of "the number of pages put back".
In addition, users of this functions don't use return value.
Let's remove unnecessary code.
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
include/linux/migrate.h | 4 ++--
mm/migrate.c | 7 +------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 7f085c9..7a07b17 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -9,7 +9,7 @@ typedef struct page *new_page_t(struct page *, unsigned long private, int **);
#ifdef CONFIG_MIGRATION
#define PAGE_MIGRATION 1
-extern int putback_lru_pages(struct list_head *l);
+extern void putback_lru_pages(struct list_head *l);
extern int migrate_page(struct address_space *,
struct page *, struct page *);
extern int migrate_pages(struct list_head *l, new_page_t x,
@@ -25,7 +25,7 @@ extern int migrate_vmas(struct mm_struct *mm,
#else
#define PAGE_MIGRATION 0
-static inline int putback_lru_pages(struct list_head *l) { return 0; }
+static inline void putback_lru_pages(struct list_head *l) {}
static inline int migrate_pages(struct list_head *l, new_page_t x,
unsigned long private, int offlining) { return -ENOSYS; }
diff --git a/mm/migrate.c b/mm/migrate.c
index 88000b8..6903abf 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -57,23 +57,18 @@ int migrate_prep(void)
/*
* Add isolated pages on the list back to the LRU under page lock
* to avoid leaking evictable pages back onto unevictable list.
- *
- * returns the number of pages put back.
*/
-int putback_lru_pages(struct list_head *l)
+void putback_lru_pages(struct list_head *l)
{
struct page *page;
struct page *page2;
- int count = 0;
list_for_each_entry_safe(page, page2, l, lru) {
list_del(&page->lru);
dec_zone_page_state(page, NR_ISOLATED_ANON +
page_is_file_cache(page));
putback_lru_page(page);
- count++;
}
- return count;
}
/*
--
1.6.5
--
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] 4+ messages in thread
* Re: [PATCH] mm: remove return value of putback_lru_pages
2010-03-15 13:16 [PATCH] mm: remove return value of putback_lru_pages Minchan Kim
@ 2010-03-15 13:40 ` Rik van Riel
2010-03-15 23:54 ` KAMEZAWA Hiroyuki
2010-03-16 0:21 ` KOSAKI Motohiro
2 siblings, 0 replies; 4+ messages in thread
From: Rik van Riel @ 2010-03-15 13:40 UTC (permalink / raw)
To: Minchan Kim; +Cc: Andrew Morton, KOSAKI Motohiro, linux-kernel, linux-mm
On 03/15/2010 09:16 AM, Minchan Kim wrote:
>
> Now putback_lru_page never can fail.
> So it doesn't matter count of "the number of pages put back".
>
> In addition, users of this functions don't use return value.
>
> Let's remove unnecessary code.
>
> Signed-off-by: Minchan Kim<minchan.kim@gmail.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
--
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] 4+ messages in thread
* Re: [PATCH] mm: remove return value of putback_lru_pages
2010-03-15 13:16 [PATCH] mm: remove return value of putback_lru_pages Minchan Kim
2010-03-15 13:40 ` Rik van Riel
@ 2010-03-15 23:54 ` KAMEZAWA Hiroyuki
2010-03-16 0:21 ` KOSAKI Motohiro
2 siblings, 0 replies; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-03-15 23:54 UTC (permalink / raw)
To: Minchan Kim
Cc: Andrew Morton, Rik van Riel, KOSAKI Motohiro, linux-kernel, linux-mm
On Mon, 15 Mar 2010 22:16:34 +0900
Minchan Kim <minchan.kim@gmail.com> wrote:
>
> Now putback_lru_page never can fail.
> So it doesn't matter count of "the number of pages put back".
>
> In addition, users of this functions don't use return value.
>
> Let's remove unnecessary code.
>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> ---
> include/linux/migrate.h | 4 ++--
> mm/migrate.c | 7 +------
> 2 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/migrate.h b/include/linux/migrate.h
> index 7f085c9..7a07b17 100644
> --- a/include/linux/migrate.h
> +++ b/include/linux/migrate.h
> @@ -9,7 +9,7 @@ typedef struct page *new_page_t(struct page *, unsigned long private, int **);
> #ifdef CONFIG_MIGRATION
> #define PAGE_MIGRATION 1
>
> -extern int putback_lru_pages(struct list_head *l);
> +extern void putback_lru_pages(struct list_head *l);
> extern int migrate_page(struct address_space *,
> struct page *, struct page *);
> extern int migrate_pages(struct list_head *l, new_page_t x,
> @@ -25,7 +25,7 @@ extern int migrate_vmas(struct mm_struct *mm,
> #else
> #define PAGE_MIGRATION 0
>
> -static inline int putback_lru_pages(struct list_head *l) { return 0; }
> +static inline void putback_lru_pages(struct list_head *l) {}
> static inline int migrate_pages(struct list_head *l, new_page_t x,
> unsigned long private, int offlining) { return -ENOSYS; }
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 88000b8..6903abf 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -57,23 +57,18 @@ int migrate_prep(void)
> /*
> * Add isolated pages on the list back to the LRU under page lock
> * to avoid leaking evictable pages back onto unevictable list.
> - *
> - * returns the number of pages put back.
> */
> -int putback_lru_pages(struct list_head *l)
> +void putback_lru_pages(struct list_head *l)
> {
> struct page *page;
> struct page *page2;
> - int count = 0;
>
> list_for_each_entry_safe(page, page2, l, lru) {
> list_del(&page->lru);
> dec_zone_page_state(page, NR_ISOLATED_ANON +
> page_is_file_cache(page));
> putback_lru_page(page);
> - count++;
> }
> - return count;
> }
>
> /*
> --
> 1.6.5
>
>
>
> --
> 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>
>
--
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] 4+ messages in thread
* Re: [PATCH] mm: remove return value of putback_lru_pages
2010-03-15 13:16 [PATCH] mm: remove return value of putback_lru_pages Minchan Kim
2010-03-15 13:40 ` Rik van Riel
2010-03-15 23:54 ` KAMEZAWA Hiroyuki
@ 2010-03-16 0:21 ` KOSAKI Motohiro
2 siblings, 0 replies; 4+ messages in thread
From: KOSAKI Motohiro @ 2010-03-16 0:21 UTC (permalink / raw)
To: Minchan Kim
Cc: kosaki.motohiro, Andrew Morton, Rik van Riel, linux-kernel, linux-mm
>
> Now putback_lru_page never can fail.
> So it doesn't matter count of "the number of pages put back".
>
> In addition, users of this functions don't use return value.
>
> Let's remove unnecessary code.
>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Thanks.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
--
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] 4+ messages in thread
end of thread, other threads:[~2010-03-16 0:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-15 13:16 [PATCH] mm: remove return value of putback_lru_pages Minchan Kim
2010-03-15 13:40 ` Rik van Riel
2010-03-15 23:54 ` KAMEZAWA Hiroyuki
2010-03-16 0:21 ` KOSAKI Motohiro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox