linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Yafang Shao <laoar.shao@gmail.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 14:20:49 +0100	[thread overview]
Message-ID: <Zd3hsVlxGCLyXjRf@tiehlicka> (raw)
In-Reply-To: <CALOAHbBuVjCs-u1DYxY-s_nktjsXeBCDgfN8GYG-s3_RNPKSuA@mail.gmail.com>

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

> 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
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.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2024-02-27 13:20 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 [this message]
2024-02-27 14:03               ` Yafang Shao
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=Zd3hsVlxGCLyXjRf@tiehlicka \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --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