linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Vaca Cintora <albertvaka@gmail.com>
To: jack@suse.cz, ebiederm@xmission.com,
	linux-kernel@vger.kernel.org, nsaenzjulienne@suse.de
Cc: Albert Vaca Cintora <albertvaka@gmail.com>
Subject: [PATCH 0/1] kernel/ucounts: expose current inotify watch count
Date: Mon, 21 Jan 2019 17:45:10 +0100	[thread overview]
Message-ID: <20190121164511.10822-1-albertvaka@gmail.com> (raw)

This patch enables reading the amount of inotify watches in use.

Inotify watches are a finite resource, in a similar way to available file
descriptors. However, there is no way to check how many watches we have
available or in use, we can only read the max.

This patch adds a 'current_inotify_watches' entry to the per-user sysctl table
that gets mounted under /proc/sys/user/. This is the same table that contains
'max_inotify_watches'.

The motivation for this patch is to be able to set up monitoring and alerting
before an application starts failing because it runs out of inotify watches.

Albert Vaca Cintora (1):
  kernel/ucounts: expose current inotify watch count

 kernel/ucount.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

--
2.20.1


             reply	other threads:[~2019-01-21 16:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21 16:45 Albert Vaca Cintora [this message]
2019-01-21 16:45 ` [PATCH 1/1] kernel/ucounts: expose current inotify watch count Albert Vaca Cintora
2019-01-22 10:35   ` Jan Kara

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=20190121164511.10822-1-albertvaka@gmail.com \
    --to=albertvaka@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsaenzjulienne@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).