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 2F9FEC7115E for ; Thu, 19 Jun 2025 08:05:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C57366B0095; Thu, 19 Jun 2025 04:05:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C28356B0096; Thu, 19 Jun 2025 04:05:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3E0A6B0098; Thu, 19 Jun 2025 04:05:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A80FE6B0095 for ; Thu, 19 Jun 2025 04:05:02 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 56A51BA3F1 for ; Thu, 19 Jun 2025 08:05:02 +0000 (UTC) X-FDA: 83571414444.04.DE54C64 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf25.hostedemail.com (Postfix) with ESMTP id ED44EA000A for ; Thu, 19 Jun 2025 08:04:59 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=qV4ZAk1x; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=DCwPT26y; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="F14/RhsO"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=D0fulWgP; spf=pass (imf25.hostedemail.com: domain of jack@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750320300; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=T9tK8I/Q1RuDUNKJbS5HFbDvN87u0BlSb6P1raJhR/Y=; b=q+JkyT5B1IqTVUc2LUC/TQsmXMYepnmHleX21fJnaKIJ/yanOXfEw/QtIqjCFIj3T/XSxA yBX7AiLNGhDp/BnEZXRbPLWdPgV7x/KtqtNdE/ocqlUoqwVoCY6ktN+Uli+8N9d97j3dts 96913jRIwYtohzWEUjl59JHIq8ZWFTI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750320300; a=rsa-sha256; cv=none; b=ntClnOXNtyDaxk6Yb9gV6b/WzybaPB/L1+3/MCXnfNydywybo/nWtpxvCfdHSF2KLeCjj9 w7z+Qs9XRsIXV5xx5yPAxHk4lLN2goTiZGyvugZUJaB2kDrKQGu7HEX7mb4lNa2M3Qcw8b CY85noTZkdsuomBiVLoJdB6NAnTa6Rc= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=qV4ZAk1x; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=DCwPT26y; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="F14/RhsO"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=D0fulWgP; spf=pass (imf25.hostedemail.com: domain of jack@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id 10B6B1F38D; Thu, 19 Jun 2025 08:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1750320298; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=T9tK8I/Q1RuDUNKJbS5HFbDvN87u0BlSb6P1raJhR/Y=; b=qV4ZAk1xOpeep+2wuxQ9eVRiMcnmcq7d5nQk+FcnPAUvTaxCKSE3xrVAMJt03ZyMf59D8m wR1bi6/sJ1X1nQU3GCVEoatGvzfxM3+s1Fqm8oyksAkyrk7iKkltWA0V2Dw6d4uMvm3F0W GdMZRglRKoQ/HPiveUvlUnH4K1qkhSo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1750320298; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=T9tK8I/Q1RuDUNKJbS5HFbDvN87u0BlSb6P1raJhR/Y=; b=DCwPT26ympUpgRDG5u31i3DmStOmi2k8OHp00O/tw2SXmu9/tGFrW9GZwqB2ebs+xKILIA lPIhESnGR4YJNDCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1750320297; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=T9tK8I/Q1RuDUNKJbS5HFbDvN87u0BlSb6P1raJhR/Y=; b=F14/RhsOG85KUrUZtUhzvqbUUmz9ZYsPR+P48pPUZh+d6cjAtMGaPxMJ5w3msp3obKCfAU KeD+qUXnnVC1wHEYyj1IKRG+Msn41PZqhwPI3rK2K6TbJhmbfgZsvWO9J5RFBlbVZjYHrt yxee3S1EdMWbxNruyMT2xYBFaX2sRs4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1750320297; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=T9tK8I/Q1RuDUNKJbS5HFbDvN87u0BlSb6P1raJhR/Y=; b=D0fulWgPAXA28aOQkWf1m3PkSOVzGVFu04vFk8DFtU+htyrvU7MtKaMASx+ibAv9qf/sEh Y3CUVkHsekSkgxBg== 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 00B56136CC; Thu, 19 Jun 2025 08:04:57 +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 ROUkAKnEU2g4LgAAD6G6ig (envelope-from ); Thu, 19 Jun 2025 08:04:57 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id AD44DA29F1; Thu, 19 Jun 2025 10:04:56 +0200 (CEST) Date: Thu, 19 Jun 2025 10:04:56 +0200 From: Jan Kara To: Shakeel Butt Cc: Zhongkun He , akpm@linux-foundation.org, tytso@mit.edu, jack@suse.com, hannes@cmpxchg.org, mhocko@kernel.org, muchun.song@linux.dev, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org Subject: Re: [PATCH 0/2] Postpone memcg reclaim to return-to-user path Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Action: no action X-Rspamd-Server: rspam03 X-Stat-Signature: sydyexgggxbzs1pcirt3s7xh9pxc4gwh X-Rspam-User: X-Rspamd-Queue-Id: ED44EA000A X-HE-Tag: 1750320299-85303 X-HE-Meta: U2FsdGVkX1+1d7BOmztEaVzlIR0yIwrWAJKR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XIP14B5M+DX8YPGUIJ+joREHLKU0PnjYi9l08pXvhJuBTwroEzdvBErC0f+odHKW0kXh6UpMQjJynZxp5ss9bRlbe3K1I8SZZ9PBwKPfGamM7Ms4NymylyUyi3rtsIi42qz07GVEgs8/ap6lTK0q/JMTjkJoULbjqo4gzBzSzm8HEvMPneKpvqjZnucZN/ZFgJEqukXg/BK9jHQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 Wed 18-06-25 15:37:20, Shakeel Butt wrote: > > This is > > beneficial for users who perform over-max reclaim while holding multiple > > locks or other resources (especially resources related to file system > > writeback). If a task needs any of these resources, it would otherwise > > have to wait until the other task completes reclaim and releases the > > resources. Postponing reclaim to the return-to-user path helps avoid this issue. > > > > # Background > > > > We have been encountering an hungtask issue for a long time. Specifically, > > when a task holds the jbd2 handler > > Can you explain a bit more about jbd2 handler? Is it some global shared > lock or a workqueue which can only run single thread at a time. > Basically is there a way to get the current holder/owner of jbd2 handler > programmatically? There's a typo in the original email :). It should be "jbd2 handle". And that is just a reference to the currently running transaction in ext4 filesystem. There can be always at most one running transaction in ext4 filesystem and until the last reference is dropped it cannot commit. This eventually (once the transaction reaches its maximum size) blocks all the other modifications to the filesystem. So it is shared global resource that's held by the process doing reclaim. Since there can be many holders of references to the currently running transaction there's no easy way to iterate processes that are holding the references... That being said ext4 sets current->journal_info when acquiring a journal handle but other filesystems use this field for other purposes so current->journal_info being non-NULL does not mean jbd2 handle is held. Honza -- Jan Kara SUSE Labs, CR