All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: russell@rickstewart.com, bugme-daemon@bugzilla.kernel.org,
	linux-fsdevel@vger.kernel.org,
	John McCutchan <john@johnmccutchan.com>,
	Robert Love <rlove@rlove.org>
Subject: Re: [Bugme-new] [Bug 12754] New: inotify doesn't free memory allocated to watches
Date: Tue, 24 Feb 2009 23:23:37 +0000	[thread overview]
Message-ID: <20090224232337.GJ28946@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20090224213800.GI28946@ZenIV.linux.org.uk>

On Tue, Feb 24, 2009 at 09:38:00PM +0000, Al Viro wrote:
> On Tue, Feb 24, 2009 at 01:05:23PM -0800, Andrew Morton wrote:
> 
> > > We have webcams that take photos every 5 minutes.  I run a daemon
> > > that detects the creation of a new webcam photo then makes a thumbnail
> > > of it.  Eventually it stopped working.  I figured out that I could
> > > not create new watches:  inotify_add_watch reported "No space left on device".
> > > I create all the watches with the ONESHOT parameter so they are deleted
> > > as soon as they are triggered.  When I make it display the watch number
> > > it's always 3.  A new watch is added only when the old watch has been
> > > triggered.  inotify isn't recovering the memory from deleted watches.

IN_ONESHOT means that they will be *removed* as they are triggered.  You still
have to call put_inotify_watch() from your ->handle_event() when you get
IN_ONESHOT in the mask.  IOW, check your ->handle_event(); unless it does
that put_inotify_watch(), you are leaking.

  reply	other threads:[~2009-02-24 23:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-12754-10286@http.bugzilla.kernel.org/>
2009-02-24 21:05 ` [Bugme-new] [Bug 12754] New: inotify doesn't free memory allocated to watches Andrew Morton
2009-02-24 21:38   ` Al Viro
2009-02-24 23:23     ` Al Viro [this message]
2009-02-24 23:40       ` Andrew Morton
2009-02-25  0:28         ` Al Viro
2009-02-25  0:40           ` Andrew Morton
2009-02-25  2:38           ` Josef Bacik
2009-02-25  3:13             ` Al Viro

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=20090224232337.GJ28946@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=john@johnmccutchan.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rlove@rlove.org \
    --cc=russell@rickstewart.com \
    /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.