All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasily Novikov <vasily.novikov@kaspersky.com>
To: Douglas Leeder <douglas.leeder@sophos.com>
Cc: Eric Paris <eparis@redhat.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"malware-list@dmesg.printk.net" <malware-list@dmesg.printk.net>
Subject: Re: [malware-list] A few concerns about fanotify implementation.
Date: Mon, 6 Jun 2011 13:19:02 +0400	[thread overview]
Message-ID: <4DEC9B86.6060506@kaspersky.com> (raw)
In-Reply-To: <C511438CDC161C41B3C47B91D99ABA8D37B4B42114@UK-EXCHMBX1.green.sophos>

>> 1. The file is thrown out of the cache only when it is modified. But in
>> case there are different scan options for different dirs that's not
>> enough. So we also need it to be evicted from cache on rename or number
>> of hard links change.
>
> This is interesting, as it makes the cache less efficient for those
> users who don't have different scanning within a filesystem.
>
> Our only equivalent things are exclusions, which we handle by not
> marking the responses for exclusions as cache-able.
>

I suppose rename or make hard link is less frequent operation then 
modify so I believe it won't add a significant overhead.

>> 2. We can't use unlimited cache because it can potentially grab too much
>> memory and slow down a system. In case we use limited cache it can be
>> easily filled with not very frequently used files. So the only option we
>> have at the moment is to clear cache every time it is full.
>> The solution we consider the most appropriate is to introduce
>> replaceable marks and LRU cache for them in fanotify.
>> So we suggest to introduce a new flag FAN_MARK_REPLACEABLE for marks.
>
> IIRC the cache is stored in the inodes themselves, so will automatically
> be culled as inodes are pushed out of memory?

If I understood the code correctly there is no cache by itself. It's 
just implemented through marks and it's ignored_mask field. So there is 
a list of marks for each inode that is empty initially. But when you add 
mark to this list you allocate fsnotify_mark structure which is about 64 
bytes.

-- 
Best regards,

Vasily Novikov | Software developer | Kaspersky Lab

Direct: +7 495 123 45 67 x2344 | Mobile: +7 964 786 44 82 | 
vasily.novikov@kaspersky.com
10/1, 1st Volokolamsky Proezd, Moscow, 123060, Russia | 
www.kaspersky.com,  www.securelist.com

  reply	other threads:[~2011-06-06  9:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26 12:13 A few concerns about fanotify implementation Vasily Novikov
2010-10-26 12:58 ` [malware-list] " Tvrtko Ursulin
2010-10-26 13:58   ` Vasily Novikov
2010-10-26 14:22     ` Tvrtko Ursulin
     [not found]       ` <201010261522.34157.tvrtko.ursulin-j34lQMj1tz/QT0dZR+AlfA@public.gmane.org>
2010-10-26 14:58         ` Eric Paris
2010-10-27  8:54   ` [malware-list] " Vasily Novikov
2010-10-27 15:58     ` Eric Paris
     [not found]       ` <1288195134.2655.202.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2011-06-03  9:43         ` Vasily Novikov
     [not found]           ` <4DE8ACAD.2080003-BkmlMuIjteXqlBn2x/YWAg@public.gmane.org>
2011-06-06  9:02             ` Douglas Leeder
2011-06-06  9:19               ` Vasily Novikov [this message]
     [not found]                 ` <4DEC9B86.6060506-BkmlMuIjteXqlBn2x/YWAg@public.gmane.org>
2011-06-06 13:43                   ` Eric Paris
2011-06-06 14:42                     ` [malware-list] " Vasily Novikov
     [not found]                       ` <4DECE76E.4060507-BkmlMuIjteXqlBn2x/YWAg@public.gmane.org>
2011-06-06 15:53                         ` Eric Paris
2011-06-07 12:35                           ` [malware-list] " Vasily Novikov
     [not found]               ` <C511438CDC161C41B3C47B91D99ABA8D37B4B42114-u5UUZ0l8pcxUerCGrXd8jcc3qqyFMPEu@public.gmane.org>
2011-06-06  9:42                 ` Vasily Novikov
2011-06-06 10:27           ` [malware-list] " Lino Sanfilippo
2011-06-06 11:17             ` [malware-list] A few concerns about fanotify implementation ([PATCH] inside) Lino Sanfilippo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DEC9B86.6060506@kaspersky.com \
    --to=vasily.novikov@kaspersky.com \
    --cc=douglas.leeder@sophos.com \
    --cc=eparis@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=malware-list@dmesg.printk.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.