Return-Path: Received: from mx2.suse.de ([195.135.220.15]:48718 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933297AbdC3OJt (ORCPT ); Thu, 30 Mar 2017 10:09:49 -0400 Date: Thu, 30 Mar 2017 16:09:45 +0200 From: Jan Kara To: Miklos Szeredi Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Amir Goldstein , Paul Moore Subject: Re: [PATCH 17/33] fsnotify: Free fsnotify_mark_connector when there is no mark attached Message-ID: <20170330140945.GB3899@quack2.suse.cz> References: <20170328161332.29736-1-jack@suse.cz> <20170328161332.29736-18-jack@suse.cz> <20170330100235.GB25833@veci.piliscsaba.szeredi.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170330100235.GB25833@veci.piliscsaba.szeredi.hu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu 30-03-17 12:02:35, Miklos Szeredi wrote: > On Tue, Mar 28, 2017 at 06:13:16PM +0200, Jan Kara wrote: > > Currently we free fsnotify_mark_connector structure only when inode / > > vfsmount is getting freed. This can however impose noticeable memory > > overhead when marks get attached to inodes only temporarily. So free the > > connector structure once the last mark is detached from the object. > > Since notification infrastructure can be working with the connector > > under the protection of fsnotify_mark_srcu, we have to be careful and > > free the fsnotify_mark_connector only after SRCU period passes. > > Hmm, I'm thinking about the corner case when connector gets created and removed > repeatedly. Is this a potential DoS problem? Should perhaps creating new > connectors be throttled when the destroy_list becomes too large? > > Probably not a big issue, but perhaps needs to be addressed in some way at the > end of the series... Well, given marks themselves are SRCU freed (and not accounted in any counters by the time they are in that phase) we already have that problem since fsnotify framework beginning. I'm not saying we should not address this but IMO it isn't a pressing issue and I would not complicate this series with it. Honza -- Jan Kara SUSE Labs, CR