Thread (10 messages) 10 messages, 3 authors, 2021-10-28

Re: [RFC PATCH] mm: have kswapd only reclaiming use min protection on memcg

From: Zhaoyang Huang <hidden>
Date: 2021-10-27 07:46:43
Also in: lkml

On Wed, Oct 27, 2021 at 3:20 PM Michal Hocko [off-list ref] wrote:
On Wed 27-10-21 15:01:50, Huangzhaoyang wrote:
quoted
From: Zhaoyang Huang <redacted>

For the kswapd only reclaiming, there is no chance to try again on
this group while direct reclaim has. fix it by judging gfp flag.
There is no problem description (same as in your last submissions. Have
you looked at the patch submission documentation as recommended
previously?).

Also this patch doesn't make any sense. Both direct reclaim and kswapd
use a gfp mask which contains __GFP_DIRECT_RECLAIM (see balance_pgdat
for the kswapd part)..
ok, but how does the reclaiming try with memcg's min protection on the
alloc without __GFP_DIRECT_RECLAIM?
quoted
Signed-off-by: Zhaoyang Huang <redacted>
Nacked-by: Michal Hocko [off-list ref]
quoted
---
 mm/vmscan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 74296c2..41f5776 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2704,7 +2704,8 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
                      unsigned long protection;

                      /* memory.low scaling, make sure we retry before OOM */
-                     if (!sc->memcg_low_reclaim && low > min) {
+                     if (!sc->memcg_low_reclaim && low > min
+                             && sc->gfp_mask & __GFP_DIRECT_RECLAIM) {
                              protection = low;
                              sc->memcg_low_skipped = 1;
                      } else {
--
1.9.1
--
Michal Hocko
SUSE Labs
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help