vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n
diff mbox series

Message ID 20181113041750.20784-1-richard.weiyang@gmail.com
State New
Headers show
Series
  • vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n
Related show

Commit Message

Wei Yang Nov. 13, 2018, 4:17 a.m. UTC
Commit fa5e084e43eb ("vmscan: do not unconditionally treat zones that
fail zone_reclaim() as full") changed the return value of node_reclaim().
The original return value 0 means NODE_RECLAIM_SOME after this commit.

While the return value of node_reclaim() when CONFIG_NUMA is n is not
changed. This will leads to call zone_watermark_ok() again.

This patch fix the return value by adjusting to NODE_RECLAIM_NOSCAN. Since
it is not proper to include "mm/internal.h", just hard coded it.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---

This doesn't effect the system functionally. I am not sure we need to cc to
stable tree?

---
 include/linux/swap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Wilcox Nov. 13, 2018, 5:36 a.m. UTC | #1
On Tue, Nov 13, 2018 at 12:17:50PM +0800, Wei Yang wrote:
> Commit fa5e084e43eb ("vmscan: do not unconditionally treat zones that
> fail zone_reclaim() as full") changed the return value of node_reclaim().
> The original return value 0 means NODE_RECLAIM_SOME after this commit.
> 
> While the return value of node_reclaim() when CONFIG_NUMA is n is not
> changed. This will leads to call zone_watermark_ok() again.
> 
> This patch fix the return value by adjusting to NODE_RECLAIM_NOSCAN. Since
> it is not proper to include "mm/internal.h", just hard coded it.

Since the return value is defined in mm/internal.h that means no code
outside mm/ can call node_reclaim (nor should it).  So let's move both
of node_reclaim's declarations to mm/internal.h instead of keeping them
in linux/swap.h.
Wei Yang Nov. 13, 2018, 7:49 a.m. UTC | #2
On Mon, Nov 12, 2018 at 09:36:15PM -0800, Matthew Wilcox wrote:
>On Tue, Nov 13, 2018 at 12:17:50PM +0800, Wei Yang wrote:
>> Commit fa5e084e43eb ("vmscan: do not unconditionally treat zones that
>> fail zone_reclaim() as full") changed the return value of node_reclaim().
>> The original return value 0 means NODE_RECLAIM_SOME after this commit.
>> 
>> While the return value of node_reclaim() when CONFIG_NUMA is n is not
>> changed. This will leads to call zone_watermark_ok() again.
>> 
>> This patch fix the return value by adjusting to NODE_RECLAIM_NOSCAN. Since
>> it is not proper to include "mm/internal.h", just hard coded it.
>
>Since the return value is defined in mm/internal.h that means no code
>outside mm/ can call node_reclaim (nor should it).  So let's move both
>of node_reclaim's declarations to mm/internal.h instead of keeping them
>in linux/swap.h.

That's reasonable, thanks.

Patch
diff mbox series

diff --git a/include/linux/swap.h b/include/linux/swap.h
index d8a07a4f171d..2bd993280470 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -364,7 +364,7 @@  extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int);
 static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask,
 				unsigned int order)
 {
-	return 0;
+	return -2;	/* NODE_RECLAIM_NOSCAN */
 }
 #endif