aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/audit_fsnotify.c
diff options
context:
space:
mode:
authorWaiman Long <longman@redhat.com>2020-11-08 22:59:31 -0500
committerJan Kara <jack@suse.cz>2020-11-09 15:03:21 +0100
commit92890123749bafc317bbfacbe0a62ce08d78efb7 (patch)
tree68da40392188cfb0dda54ca7788b5eb094486e08 /kernel/audit_fsnotify.c
parentfanotify: fix logic of reporting name info with watched parent (diff)
downloadlinux-dev-92890123749bafc317bbfacbe0a62ce08d78efb7.tar.xz
linux-dev-92890123749bafc317bbfacbe0a62ce08d78efb7.zip
inotify: Increase default inotify.max_user_watches limit to 1048576
The default value of inotify.max_user_watches sysctl parameter was set to 8192 since the introduction of the inotify feature in 2005 by commit 0eeca28300df ("[PATCH] inotify"). Today this value is just too small for many modern usage. As a result, users have to explicitly set it to a larger value to make it work. After some searching around the web, these are the inotify.max_user_watches values used by some projects: - vscode: 524288 - dropbox support: 100000 - users on stackexchange: 12228 - lsyncd user: 2000000 - code42 support: 1048576 - monodevelop: 16384 - tectonic: 524288 - openshift origin: 65536 Each watch point adds an inotify_inode_mark structure to an inode to be watched. It also pins the watched inode. Modeled after the epoll.max_user_watches behavior to adjust the default value according to the amount of addressable memory available, make inotify.max_user_watches behave in a similar way to make it use no more than 1% of addressable memory within the range [8192, 1048576]. We estimate the amount of memory used by inotify mark to size of inotify_inode_mark plus two times the size of struct inode (we double the inode size to cover the additional filesystem private inode part). That means that a 64-bit system with 128GB or more memory will likely have the maximum value of 1048576 for inotify.max_user_watches. This default should be big enough for most use cases. Link: https://lore.kernel.org/r/20201109035931.4740-1-longman@redhat.com Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'kernel/audit_fsnotify.c')
0 files changed, 0 insertions, 0 deletions