From: Yafang Shao <laoar.shao@gmail.com>
To: Michal Hocko <mhocko@suse.com>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
roman.gushchin@linux.dev, shakeelb@google.com,
muchun.song@linux.dev, linux-mm@kvack.org
Subject: Re: [RFC PATCH] mm: Add reclaim type to memory.reclaim
Date: Tue, 27 Feb 2024 22:03:22 +0800 [thread overview]
Message-ID: <CALOAHbADrCWTNeLA1GaswZHyfgx0Lk_9NaCCNn5cTKR+Uj=+9w@mail.gmail.com> (raw)
In-Reply-To: <Zd3hsVlxGCLyXjRf@tiehlicka>
On Tue, Feb 27, 2024 at 9:20 PM Michal Hocko <mhocko@suse.com> wrote:
>
> On Tue 27-02-24 18:06:05, Yafang Shao wrote:
> > On Tue, Feb 27, 2024 at 5:45 PM Michal Hocko <mhocko@suse.com> wrote:
> [...]
> > > > Reclaiming numerous dentries through force_empty can also lead to
> > > > potential issues, which is why we attempt to shrink the slab gradually
> > > > to mitigate them. However, it's important to note that the underlying
> > > > causes of the issues in force_empty and rmdir are not identical, as
> > > > they involve different locks.
> > >
> > > Please be more specific about those issues.
> >
> > Both of these issues stem from lock contention:
> >
> > - rmdir
> > When executing rmdir, the lock of the inode of the empty directory is
> > held. If this directory contains numerous negative dentries, this lock
> > is held for an extended duration. Consequently, if other processes
> > attempt to acquire this lock, they are blocked.
> > A simple reproducer involves:
> >
> > 1. Generating numerous negative dentries in an empty directory.
> > 2. Running `rmdir ~/test` and `ls ~/` concurrently.
>
> I fail to see how is this relevant to memcg reclaim
It appears there might still be some misunderstanding regarding the
issue at hand.
The numerous negative dentries are generated within a memcg. I
simplified the explanation by omitting the memcg context.
>
> > This setup demonstrates that ls takes a significant amount of time to
> > complete due to lock contention.
> >
> > - force_empty
> > Force_empty holds the lock of super_block->dentry_list. However, I
> > haven't yet had the opportunity to produce a specific example to
> > illustrate this issue.
>
> OK, get back to us once you can identify an actual problem. We might be
Pls. take a look at the force_empty->prune_dcache_sb->shrink_dentry_list.
> talking about different things here though. My question is directed at
> existing memcg interfaces to reclaim the memory. That would be legacy
> (and effectively deprecated) force_empty and memory.reclaim that we
> have.
--
Regards
Yafang
next prev parent reply other threads:[~2024-02-27 14:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-25 11:42 Yafang Shao
2024-02-26 4:17 ` Matthew Wilcox
2024-02-26 12:34 ` Yafang Shao
2024-02-26 13:16 ` Matthew Wilcox
2024-02-26 13:56 ` Yafang Shao
2024-02-26 14:04 ` Michal Hocko
2024-02-27 5:48 ` Yafang Shao
2024-02-27 9:05 ` Michal Hocko
2024-02-27 9:39 ` Yafang Shao
2024-02-27 9:43 ` Yosry Ahmed
2024-02-27 11:37 ` Yafang Shao
2024-02-27 11:40 ` Yosry Ahmed
2024-02-27 11:58 ` Yafang Shao
2024-02-27 12:09 ` Yafang Shao
2024-02-27 12:12 ` Yafang Shao
2024-02-27 13:17 ` Michal Hocko
2024-02-27 14:05 ` Yafang Shao
2024-02-27 9:45 ` Michal Hocko
2024-02-27 10:06 ` Yafang Shao
2024-02-27 13:20 ` Michal Hocko
2024-02-27 14:03 ` Yafang Shao [this message]
2024-02-27 14:51 ` Yafang Shao
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='CALOAHbADrCWTNeLA1GaswZHyfgx0Lk_9NaCCNn5cTKR+Uj=+9w@mail.gmail.com' \
--to=laoar.shao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeelb@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