From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Paris Subject: Re: A few concerns about fanotify implementation. Date: Mon, 06 Jun 2011 11:53:11 -0400 Message-ID: <1307375593.2052.7.camel@localhost.localdomain> References: <1288095195.29745.4010.camel@novikov-v> <201010261358.46974.tvrtko.ursulin@sophos.com> <1288169699.7715.103.camel@novikov-v> <1288195134.2655.202.camel@localhost.localdomain> <4DE8ACAD.2080003@kaspersky.com> <4DEC9B86.6060506@kaspersky.com> <1307367787.2052.6.camel@localhost.localdomain> <4DECE76E.4060507@kaspersky.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: "linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "malware-list-h+Im9A44IAFcMpApZELgcQ@public.gmane.org" , Douglas Leeder To: Vasily Novikov Return-path: In-Reply-To: <4DECE76E.4060507-BkmlMuIjteXqlBn2x/YWAg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: malware-list-bounces-h+Im9A44IAFcMpApZELgcQ@public.gmane.org Errors-To: malware-list-bounces-h+Im9A44IAFcMpApZELgcQ@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On Mon, 2011-06-06 at 18:42 +0400, Vasily Novikov wrote: > On 06/06/2011 05:43 PM, Eric Paris wrote: > > Well, you are both correct. If you add a mark with only 'ignored' > > events set it will not pin the inode into the kernel. If the system > > starts to get under memory pressure the kernel will kick unused inodes > > and any associated ignored marks out of ram. Inodes with 'real' events > > attached will be pinned in memory and cannot be evicted under memory > > pressure. > > So if we use marks with only 'ignored' events then under memory pressure > mm subsystem will shrink inode cache that will free our marks and > therefore it's safe to use FAN_UNLIMITED_MARKS in this case? > If it really works then we don't need LRU cache in fanotify because it's > already implemented in dentry_cache/inode_cache. That's how it's supposed to work. Just remember, if you set a real event, the inode becomes pinned in core and the mm will be unable to evict either the inode or the mark. -Eric