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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5332AC433EF for ; Tue, 19 Oct 2021 11:52:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A7F361361 for ; Tue, 19 Oct 2021 11:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235206AbhJSLy5 (ORCPT ); Tue, 19 Oct 2021 07:54:57 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:44706 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbhJSLy4 (ORCPT ); Tue, 19 Oct 2021 07:54:56 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id CBAD31FCA1; Tue, 19 Oct 2021 11:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634644362; 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=vZ6SqWivaR7J+dDBdJR9QxTbgDItdfol945P7TBlZUE=; b=zObd7a2rc4SIjVkSCsPQj8lWgOtFi1QSA+hc781Sp22V8T6PUnBd+CQtyfxd9V+3ueKJ9z 5a//M4nSYMqNDrorLvvlWDiz2k56/W7ZGkImcpcx0hn83yWjLEDEQUrsm+WAndfceOZ23S 2cT6EIYIQHit+A9Ev+9slHYj237qjkE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634644362; 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=vZ6SqWivaR7J+dDBdJR9QxTbgDItdfol945P7TBlZUE=; b=baSY88UoYqUEcUbmOPWUfM/aisxoqpCiG+aQBVPb4crWXUydpQdDDDa6IknUrL7wBmIaWB NgjQ/B2O9oFVmoCQ== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id B83E1A3B85; Tue, 19 Oct 2021 11:52:42 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 979131E0983; Tue, 19 Oct 2021 13:52:42 +0200 (CEST) Date: Tue, 19 Oct 2021 13:52:42 +0200 From: Jan Kara To: Amir Goldstein Cc: Gabriel Krisman Bertazi , Jan Kara , "Darrick J. Wong" , Theodore Tso , Dave Chinner , David Howells , Khazhismel Kumykov , linux-fsdevel , Ext4 , Linux API , kernel@collabora.com Subject: Re: [PATCH v8 19/32] fanotify: Pre-allocate pool of error events Message-ID: <20211019115242.GH3255@quack2.suse.cz> References: <20211019000015.1666608-1-krisman@collabora.com> <20211019000015.1666608-20-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Tue 19-10-21 08:38:34, Amir Goldstein wrote: > On Tue, Oct 19, 2021 at 3:03 AM Gabriel Krisman Bertazi > wrote: > > > > Pre-allocate slots for file system errors to have greater chances of > > succeeding, since error events can happen in GFP_NOFS context. This > > patch introduces a group-wide mempool of error events, shared by all > > FAN_FS_ERROR marks in this group. > > > > For now, just allocate 128 positions. A future patch allows this > > array to be dynamically resized when a new mark is added. > > > > Signed-off-by: Gabriel Krisman Bertazi > > > > --- > > Changes since v7: > > - Expand limit to 128. (Amir) > > I am not sure if Jan was also on board with this request but otherwise > > Reviewed-by: Amir Goldstein I don't really care. I don't see a strong reason to go above original 32 (so I'd slightly prefer that) but OTOH I also don't think those few KB per notification group using FS_ERROR matter since I don't expect such groups to be that common. > > diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c > > index 66ee3c2805c7..f77581c5b97f 100644 > > --- a/fs/notify/fanotify/fanotify_user.c > > +++ b/fs/notify/fanotify/fanotify_user.c > > @@ -30,6 +30,7 @@ > > #define FANOTIFY_DEFAULT_MAX_EVENTS 16384 > > #define FANOTIFY_OLD_DEFAULT_MAX_MARKS 8192 > > #define FANOTIFY_DEFAULT_MAX_GROUPS 128 > > +#define FANOTIFY_DEFAULT_MAX_FEE_POOL 128 Perhaps FANOTIFY_DEFAULT_FEE_POOL_SIZE would better describe what this constant is about? Otherwise feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR