From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Topi Miettinen To: linux-kernel@vger.kernel.org Cc: Topi Miettinen , Alexander Viro , linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and infrastructure)) Subject: [PATCH 08/14] resource limits: track highwater mark of number of files Date: Fri, 15 Jul 2016 13:35:55 +0300 Message-Id: <1468578983-28229-9-git-send-email-toiwoton@gmail.com> In-Reply-To: <1468578983-28229-1-git-send-email-toiwoton@gmail.com> References: <1468578983-28229-1-git-send-email-toiwoton@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: Track maximum number of files for the process, to be able to configure RLIMIT_NOFILE resource limits. The information is available with taskstats and cgroupstats netlink socket. Signed-off-by: Topi Miettinen --- fs/file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/file.c b/fs/file.c index 6b1acdf..9de37c9 100644 --- a/fs/file.c +++ b/fs/file.c @@ -547,6 +547,8 @@ repeat: } #endif + update_resource_highwatermark(RLIMIT_NOFILE, fd); + out: spin_unlock(&files->file_lock); return error; @@ -857,6 +859,8 @@ __releases(&files->file_lock) if (tofree) filp_close(tofree, files); + update_resource_highwatermark(RLIMIT_NOFILE, fd); + return fd; Ebusy: -- 2.8.1