linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Make zone_reclaim() return ZONE_RECLAIM_NOSCAN not zero
@ 2015-06-26  2:39 sh.yoon
  2015-06-29 12:19 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: sh.yoon @ 2015-06-26  2:39 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: seungho1.park, sh.yoon

From: "sh.yoon" <sh.yoon@lge.com>

When zone watermark is not ok in get_page_from_freelist(), we call
zone_reclaim(). But !CONFIG_NUMA system`s zone_reclaim() just returns zero.
Zero means ZONE_RECLAIM_SOME and check zone watermark again needlessly.

To avoid needless zone watermark check, change it as ZONE_RECLAIM_NOSCAN.

Signed-off-by: sh.yoon <sh.yoon@lge.com>
---
 include/linux/swap.h | 7 ++++++-
 mm/internal.h        | 5 -----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/swap.h b/include/linux/swap.h
index 3887472..e04e435 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -332,6 +332,11 @@ extern int vm_swappiness;
 extern int remove_mapping(struct address_space *mapping, struct page *page);
 extern unsigned long vm_total_pages;
 
+#define ZONE_RECLAIM_NOSCAN	-2
+#define ZONE_RECLAIM_FULL	-1
+#define ZONE_RECLAIM_SOME	0
+#define ZONE_RECLAIM_SUCCESS	1
+
 #ifdef CONFIG_NUMA
 extern int zone_reclaim_mode;
 extern int sysctl_min_unmapped_ratio;
@@ -341,7 +346,7 @@ extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
 #define zone_reclaim_mode 0
 static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order)
 {
-	return 0;
+	return ZONE_RECLAIM_NOSCAN;
 }
 #endif
 
diff --git a/mm/internal.h b/mm/internal.h
index a25e359..d8ec7f8 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -397,11 +397,6 @@ static inline void mminit_validate_memmodel_limits(unsigned long *start_pfn,
 }
 #endif /* CONFIG_SPARSEMEM */
 
-#define ZONE_RECLAIM_NOSCAN	-2
-#define ZONE_RECLAIM_FULL	-1
-#define ZONE_RECLAIM_SOME	0
-#define ZONE_RECLAIM_SUCCESS	1
-
 extern int hwpoison_filter(struct page *p);
 
 extern u32 hwpoison_filter_dev_major;
-- 
2.1.4

--
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] 2+ messages in thread

* Re: [PATCH] mm: Make zone_reclaim() return ZONE_RECLAIM_NOSCAN not zero
  2015-06-26  2:39 [PATCH] mm: Make zone_reclaim() return ZONE_RECLAIM_NOSCAN not zero sh.yoon
@ 2015-06-29 12:19 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2015-06-29 12:19 UTC (permalink / raw)
  To: sh.yoon; +Cc: Andrew Morton, linux-mm, seungho1.park

On Fri 26-06-15 11:39:08, sh.yoon@lge.com wrote:
> From: "sh.yoon" <sh.yoon@lge.com>
> 
> When zone watermark is not ok in get_page_from_freelist(), we call
> zone_reclaim(). But !CONFIG_NUMA system`s zone_reclaim() just returns zero.
> Zero means ZONE_RECLAIM_SOME and check zone watermark again needlessly.

The return value might be indeed confusing, but

> To avoid needless zone watermark check, change it as ZONE_RECLAIM_NOSCAN.

this shouldn't happen because zone_reclaim_mode is always 0 for
!CONFIG_NUMA so we do not even get to call zone_reclaim. So this part of
the changelog is misleading.

> Signed-off-by: sh.yoon <sh.yoon@lge.com>
> ---
>  include/linux/swap.h | 7 ++++++-
>  mm/internal.h        | 5 -----
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/swap.h b/include/linux/swap.h
> index 3887472..e04e435 100644
> --- a/include/linux/swap.h
> +++ b/include/linux/swap.h
> @@ -332,6 +332,11 @@ extern int vm_swappiness;
>  extern int remove_mapping(struct address_space *mapping, struct page *page);
>  extern unsigned long vm_total_pages;
>  
> +#define ZONE_RECLAIM_NOSCAN	-2
> +#define ZONE_RECLAIM_FULL	-1
> +#define ZONE_RECLAIM_SOME	0
> +#define ZONE_RECLAIM_SUCCESS	1
> +
>  #ifdef CONFIG_NUMA
>  extern int zone_reclaim_mode;
>  extern int sysctl_min_unmapped_ratio;
> @@ -341,7 +346,7 @@ extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
>  #define zone_reclaim_mode 0
>  static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order)
>  {
> -	return 0;
> +	return ZONE_RECLAIM_NOSCAN;
>  }
>  #endif
>  
> diff --git a/mm/internal.h b/mm/internal.h
> index a25e359..d8ec7f8 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -397,11 +397,6 @@ static inline void mminit_validate_memmodel_limits(unsigned long *start_pfn,
>  }
>  #endif /* CONFIG_SPARSEMEM */
>  
> -#define ZONE_RECLAIM_NOSCAN	-2
> -#define ZONE_RECLAIM_FULL	-1
> -#define ZONE_RECLAIM_SOME	0
> -#define ZONE_RECLAIM_SUCCESS	1
> -
>  extern int hwpoison_filter(struct page *p);
>  
>  extern u32 hwpoison_filter_dev_major;
> -- 
> 2.1.4
> 
> --
> 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>

-- 
Michal Hocko
SUSE Labs

--
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] 2+ messages in thread

end of thread, other threads:[~2015-06-29 12:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-26  2:39 [PATCH] mm: Make zone_reclaim() return ZONE_RECLAIM_NOSCAN not zero sh.yoon
2015-06-29 12:19 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox