linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: Kalesh Singh <kaleshsingh@google.com>, akpm@linux-foundation.org
Cc: minchan@google.com, surenb@google.com, wvw@google.com,
	 android-mm@google.com, kernel-team@android.com,
	 Minchan Kim <minchan@kernel.org>,
	Oleksandr Natalenko <oleksandr@natalenko.name>,
	 "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>,
	Suleiman Souhlal <suleiman@google.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Multi-gen LRU: remove wait_event_killable()
Date: Thu, 13 Apr 2023 15:47:56 -0600	[thread overview]
Message-ID: <CAOUHufYjLf2RD2Y7wcebjvvDRHDT9cCG6sPbQ2JaTyyB306JOw@mail.gmail.com> (raw)
In-Reply-To: <20230413214326.2147568-1-kaleshsingh@google.com>

On Thu, Apr 13, 2023 at 3:43 PM Kalesh Singh <kaleshsingh@google.com> wrote:
>
> Android 14 and later default to MGLRU [1] and field telemetry showed
> occasional long tail latency (>100ms) in the reclaim path.
>
> Tracing revealed priority inversion in the reclaim path. In
> try_to_inc_max_seq(), when high priority tasks were blocked on
> wait_event_killable(), the preemption of the low priority task to call
> wake_up_all() caused those high priority tasks to wait longer than
> necessary. In general, this problem is not different from others of
> its kind, e.g., one caused by mutex_lock(). However, it is specific to
> MGLRU because it introduced the new wait queue lruvec->mm_state.wait.
>
> The purpose of this new wait queue is to avoid the thundering herd
> problem. If many direct reclaimers rush into try_to_inc_max_seq(),
> only one can succeed, i.e., the one to wake up the rest, and the rest
> who failed might cause premature OOM kills if they do not wait. So far
> there is no evidence supporting this scenario, based on how often the
> wait has been hit. And this begs the question how useful the wait
> queue is in practice.
>
> Based on Minchan's recommendation, which is in line with his commit
> 6d4675e60135 ("mm: don't be stuck to rmap lock on reclaim path") and
> the rest of the MGLRU code which also uses trylock when possible,
> remove the wait queue.
>
> [1] https://android-review.googlesource.com/q/I7ed7fbfd6ef9ce10053347528125dd98c39e50bf
>
> Fixes: bd74fdaea146 ("mm: multi-gen LRU: support page table walks")
> Cc: Yu Zhao <yuzhao@google.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Reported-by: Wei Wang <wvw@google.com>
> Suggested-by: Minchan Kim <minchan@kernel.org>
> Signed-off-by: Kalesh Singh <kaleshsingh@google.com>

Acked-by: Yu Zhao <yuzhao@google.com>


      reply	other threads:[~2023-04-13 21:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 21:43 Kalesh Singh
2023-04-13 21:47 ` Yu Zhao [this message]

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=CAOUHufYjLf2RD2Y7wcebjvvDRHDT9cCG6sPbQ2JaTyyB306JOw@mail.gmail.com \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=android-mm@google.com \
    --cc=heftig@archlinux.org \
    --cc=kaleshsingh@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@google.com \
    --cc=minchan@kernel.org \
    --cc=oleksandr@natalenko.name \
    --cc=suleiman@google.com \
    --cc=surenb@google.com \
    --cc=wvw@google.com \
    /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