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 ED16CC433EF for ; Wed, 23 Mar 2022 14:28:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35EC86B0072; Wed, 23 Mar 2022 10:28:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E8CD6B0073; Wed, 23 Mar 2022 10:28:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1619C6B0074; Wed, 23 Mar 2022 10:28:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id F35DA6B0072 for ; Wed, 23 Mar 2022 10:28:37 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A039F182534C7 for ; Wed, 23 Mar 2022 14:28:37 +0000 (UTC) X-FDA: 79275881874.22.B4DAFEB Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf25.hostedemail.com (Postfix) with ESMTP id 0FD90A001D for ; Wed, 23 Mar 2022 14:28:36 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 9DF9C1F37F; Wed, 23 Mar 2022 14:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648045715; 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=/Ioe1yB2nNzhePE8bUeTHN0puFfTZRbrOkfbO3s4ArA=; b=VwtovTr19MBBRUb/VJFAxZZxzSbgfaoSZkDZrmuB2zN7/YKf1BiFcULI2bLb01zbEZL6pa P/qalNHtJc+2VIlasOjsxhpCRQiRjJtodt8LJ6fXroIXQ+yf8Cb4r/78qlbLgf73YofeM2 SDqbDE9taow7gmpT315CzTWdr/bHxtw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648045715; 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=/Ioe1yB2nNzhePE8bUeTHN0puFfTZRbrOkfbO3s4ArA=; b=04pCmm2KJUO3vXdA+NaonXIJIOK4txle1uFDCEZFpXdHlTTI2dqffjLE5I5JGsuKe5AnnR H3rE2/IjH+VTk4Dg== Received: from quack3.suse.cz (unknown [10.100.224.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 6DD65A3B81; Wed, 23 Mar 2022 14:28:35 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 220A4A0610; Wed, 23 Mar 2022 15:28:35 +0100 (CET) Date: Wed, 23 Mar 2022 15:28:35 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , "khazhy@google.com" , "linux-mm@kvack.org" , linux-fsdevel Subject: Re: [PATCH RFC] nfsd: avoid recursive locking through fsnotify Message-ID: <20220323142835.epitipiq7zc55vgb@quack3.lan> References: <20220321112310.vpr7oxro2xkz5llh@quack3.lan> <20220321145111.qz3bngofoi5r5cmh@quack3.lan> <20220323104129.k4djfxtjwdgoz3ci@quack3.lan> <20220323134851.px6s4i6iiaj4zlju@quack3.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=VwtovTr1; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=04pCmm2K; spf=pass (imf25.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0FD90A001D X-Stat-Signature: imwpsyemqpojs49a5c1f3j5egmd55yir X-HE-Tag: 1648045716-469107 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: On Wed 23-03-22 16:00:30, Amir Goldstein wrote: > > Well, but reclaim from kswapd is always the main and preferred source of > > memory reclaim. And we will kick kswapd to do work if we are running out of > > memory. Doing direct filesystem slab reclaim from mark allocation is useful > > only to throttle possibly aggressive mark allocations to the speed of > > reclaim (instead of getting ENOMEM). So I'm still not convinced this is a > > big issue but I certainly won't stop you from implementing more fine > > grained GFP mode selection and lockdep annotations if you want to go that > > way :). > > Well it was just two lines of code to annotate the fanotify mutex as its own > class, so I just did that: > > https://github.com/amir73il/linux/commit/7b4b6e2c0bd1942cd130e9202c4b187a8fb468c6 But this implicitely assumes there isn't any allocation under mark_mutex anywhere else where it is held. Which is likely true (I didn't check) but it is kind of fragile. So I was rather imagining we would have per-group "NOFS" flag and fsnotify_group_lock/unlock() would call memalloc_nofs_save() based on the flag. And we would use fsnotify_group_lock/unlock() uniformly across the whole fsnotify codebase. Honza -- Jan Kara SUSE Labs, CR