From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E411FC54798 for ; Tue, 27 Feb 2024 13:20:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 70232280012; Tue, 27 Feb 2024 08:20:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B1D3280007; Tue, 27 Feb 2024 08:20:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52D45280012; Tue, 27 Feb 2024 08:20:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 42337280007 for ; Tue, 27 Feb 2024 08:20:53 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1ACE5120BAE for ; Tue, 27 Feb 2024 13:20:53 +0000 (UTC) X-FDA: 81837643986.06.E16E8D2 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf05.hostedemail.com (Postfix) with ESMTP id 163E6100002 for ; Tue, 27 Feb 2024 13:20:50 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=ibBSMWpD; dkim=pass header.d=suse.com header.s=susede1 header.b=ibBSMWpD; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf05.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.130 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709040051; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=k/wo2efqyqzBqeQoJfTHXUOwgToceLwJFKLdfBR+BzI=; b=15WJUHDdKPNwkGYaIu/0L+fdkaYkWWNxBNWRd4j8VGv9MTVh80Lx08UpYYeE1FFjtYgwi1 kfagB9bD7XCsyAuSnh2oxxGPzFrHa2r4lUr9H1Pai6z9MxnwO6ZJ8rFhx4RyuCphkgO+xQ HOEnBbYBkHAVh2OPDEwuE9GEYSoRgPk= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=ibBSMWpD; dkim=pass header.d=suse.com header.s=susede1 header.b=ibBSMWpD; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf05.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.130 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709040051; a=rsa-sha256; cv=none; b=WUHAHZeIR04k9Unbi6pQW2hhnjslVancIS/1NK8FOkbTYVly5NWg8xs7lXZJfn20tB5Gt2 ALad38E3DeIRJm6+UfcZuOFiuUkG0QtfCvi1oESETw7OVY0FHml/EZi8NcXXnyYbBImQa0 02m3oJbdlbpge/iQh9kFpAL7619AaHU= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 882DF21E6F; Tue, 27 Feb 2024 13:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709040049; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k/wo2efqyqzBqeQoJfTHXUOwgToceLwJFKLdfBR+BzI=; b=ibBSMWpDJL7aIgAhNl5WgObzfufofTXMqsBWtWL7eZWKh3YY7YX17XwKJFk0AkLmb4uSPv mA+P7RdDAG9OKhW0oh1owa97IjygW8GWHPD+clXib2eBk2dRKE6eUJRo/NTyytv+YnhY4j S1ZYPKeBa1X0G2WnJ6upBEMDVuWgFI8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1709040049; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k/wo2efqyqzBqeQoJfTHXUOwgToceLwJFKLdfBR+BzI=; b=ibBSMWpDJL7aIgAhNl5WgObzfufofTXMqsBWtWL7eZWKh3YY7YX17XwKJFk0AkLmb4uSPv mA+P7RdDAG9OKhW0oh1owa97IjygW8GWHPD+clXib2eBk2dRKE6eUJRo/NTyytv+YnhY4j S1ZYPKeBa1X0G2WnJ6upBEMDVuWgFI8= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7630F13A58; Tue, 27 Feb 2024 13:20:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 7V6LHLHh3WU8LQAAD6G6ig (envelope-from ); Tue, 27 Feb 2024 13:20:49 +0000 Date: Tue, 27 Feb 2024 14:20:49 +0100 From: Michal Hocko To: Yafang Shao 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 Message-ID: References: <20240225114204.50459-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 163E6100002 X-Stat-Signature: wjks3kg4xp5hn4dg3ykaitodhjd1nimr X-HE-Tag: 1709040050-965485 X-HE-Meta: U2FsdGVkX1+dKupqdWB9hfk5H8chiYk3GAIX8EcgarD7nP1SHCOygABmf4/DdUFsvEW6Q/NghF0UQZJLOerTDpXlJt6Dv3vo4blZn1MbCCSZSuvky/UMA/N72rnRy8rn9cRwriVcr9Lh2BqIc1FsAahGH43p13pn2zUF4JhYh/03nRKIFlK0G8ZAxEMzBp9i8bUpurXmwizYIisoDesp3mJd4z9MTvFsBrj6CMeZvF0cntGHaqQbhGEOSPsrcHqjdgNX1AmOiXKfMRxe7qVpTpiWXvE4LoH2Ro0Z7egbZU8dLnc4URxfAc/XE3eb5tT2P2U6sN9s+L8v+s+DWiQryxJGKK3PG0sZRURsECD2SxYD1omsUPPNM++jKKueC19bfRAwMVnf1mc6om3mtie1ANYGhZoU0ukTEXyBWpxhlKyIyAprBCr3RQdCtS5F43xZbrxSOnOtrmdQEglStVWOJtOQhxqYih00uYimyXnxJQlljGtKkSKSvAT501x9IJcG2pHWkfdwhSB59n3CHgg9wVwHK8lBCLhW6B23HRzS7E8D2YCEnFOa2J+tonAy49YB69aNFscBWBwb/8YvPI2lKRY5c3ZPN0zyI2/kFstNuW1x1SC9JghbopFf8zun8AoXyHNbpR/5dhohKnuFV3EISBQ7ICB7YFFX/nMGt4iGbhpWTosMD/8AHqfHoLotHV7mo+evGLgLUHuGl5gSs8TY7ttMuOWnX0KK040Q754JpkgUztI+LIKe+XmKzZa9YzMDV9iVnUZNR4ZhFaOkcJ/FpWQ32RPtWBFy/CuwTY2TLksbBIqzCBSg3GJeV5BegGxUKyDRvD0WCrjXLKFUlQRKgU791cmbZqda3h0O8T75//BeQjeB6leMdMA+8dmC/WBJwfG8ByKw0axjWyuxKtDnjq0sOBWa5IDD8cmQET0f/e1DfS31Kl7GMeMhytHDRje2WtRexWkY58JlaPCGsDQ Hyg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000703, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue 27-02-24 18:06:05, Yafang Shao wrote: > On Tue, Feb 27, 2024 at 5:45 PM Michal Hocko 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