linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: Hillf Danton <hdanton@sina.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	Charan Teja Kalla <quic_charante@quicinc.com>,
	 Jaroslav Pulchart <jaroslav.pulchart@gooddata.com>,
	Kalesh Singh <kaleshsingh@google.com>,
	 stable@vger.kernel.org
Subject: Re: [PATCH mm-unstable v1 2/4] mm/mglru: try to stop at high watermarks
Date: Mon, 11 Dec 2023 15:01:11 -0700	[thread overview]
Message-ID: <CAOUHufacCTtUE6y1x5j+6Hp3SGtWu1-u38JHTR1z6JqU4cU8_Q@mail.gmail.com> (raw)
In-Reply-To: <20231208110011.102-1-hdanton@sina.com>

On Fri, Dec 8, 2023 at 4:00 AM Hillf Danton <hdanton@sina.com> wrote:
>
> On Thu,  7 Dec 2023 23:14:05 -0700 Yu Zhao <yuzhao@google.com>
> > -static unsigned long get_nr_to_reclaim(struct scan_control *sc)
> > +static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc)
> >  {
> > +     int i;
> > +     enum zone_watermarks mark;
> > +
> >       /* don't abort memcg reclaim to ensure fairness */
> >       if (!root_reclaim(sc))
> > -             return -1;
> > +             return false;
> >
> > -     return max(sc->nr_to_reclaim, compact_gap(sc->order));
> > +     if (sc->nr_reclaimed >= max(sc->nr_to_reclaim, compact_gap(sc->order)))
> > +             return true;
> > +
> > +     /* check the order to exclude compaction-induced reclaim */
> > +     if (!current_is_kswapd() || sc->order)
> > +             return false;
> > +
> > +     mark = sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING ?
> > +            WMARK_PROMO : WMARK_HIGH;
> > +
> > +     for (i = 0; i <= sc->reclaim_idx; i++) {
> > +             struct zone *zone = lruvec_pgdat(lruvec)->node_zones + i;
> > +             unsigned long size = wmark_pages(zone, mark) + MIN_LRU_BATCH;
> > +
> > +             if (managed_zone(zone) && !zone_watermark_ok(zone, 0, size, sc->reclaim_idx, 0))
> > +                     return false;
> > +     }
> > +
> > +     /* kswapd should abort if all eligible zones are safe */
>
> This comment does not align with 86c79f6b5426
> ("mm: vmscan: do not reclaim from kswapd if there is any eligible zone").
> Any thing special here?

I don't see how they are not: they essentially say the same thing ("no
more than needed") but with different units: zones or pages. IOW,
don't reclaim from more zones or pages than needed.


  reply	other threads:[~2023-12-11 22:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  6:14 [PATCH mm-unstable v1 1/4] mm/mglru: fix underprotected page cache Yu Zhao
2023-12-08  6:14 ` [PATCH mm-unstable v1 2/4] mm/mglru: try to stop at high watermarks Yu Zhao
2023-12-08 11:00   ` Hillf Danton
2023-12-11 22:01     ` Yu Zhao [this message]
2023-12-08  6:14 ` [PATCH mm-unstable v1 3/4] mm/mglru: respect min_ttl_ms with memcgs Yu Zhao
2023-12-08  6:14 ` [PATCH mm-unstable v1 4/4] mm/mglru: reclaim offlined memcgs harder Yu Zhao
2023-12-08  8:24 ` [PATCH mm-unstable v1 1/4] mm/mglru: fix underprotected page cache Kairui Song
2023-12-11 22:06   ` Yu Zhao
2023-12-12  6:52     ` Kairui Song
2023-12-13  3:02       ` Kairui Song
2023-12-13  7:59         ` Yu Zhao
2023-12-14  3:09           ` Yu Zhao
2023-12-14 18:37             ` Kairui Song
2023-12-14 23:51               ` Yu Zhao
2023-12-15  4:56                 ` Yu Zhao
2023-12-18 18:05                   ` Kairui Song
2023-12-19  3:21                     ` Yu Zhao
2023-12-19  3:44                       ` Yu Zhao
2023-12-19 18:58                         ` Kairui Song
2023-12-20  6:38                           ` Yu Zhao
2023-12-20  8:16                             ` Yu Zhao
2023-12-20  8:24                               ` Kairui Song
2023-12-25  6:30                                 ` Yu Zhao
2023-12-25 12:02                                   ` Kairui Song
2023-12-25 21:52                                     ` Yu Zhao
2023-12-25 22:00                                       ` Yu Zhao
2024-01-10 19:16                                         ` Kairui Song
2024-01-11  7:02                                           ` Yu Zhao
2023-12-17 18:31                 ` Yu Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOUHufacCTtUE6y1x5j+6Hp3SGtWu1-u38JHTR1z6JqU4cU8_Q@mail.gmail.com \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hdanton@sina.com \
    --cc=jaroslav.pulchart@gooddata.com \
    --cc=kaleshsingh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=quic_charante@quicinc.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox