mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
inotify, memcg: account inotify instances to kmemcg
Currently the fs sysctl inotify/max_user_instances is used to limit the number of inotify instances on the system. For systems running multiple workloads, the per-user namespace sysctl max_inotify_instances can be used to further partition inotify instances. However there is no easy way to set a sensible system level max limit on inotify instances and further partition it between the workloads. It is much easier to charge the underlying resource (i.e. memory) behind the inotify instances to the memcg of the workload and let their memory limits limit the number of inotify instances they can create. With inotify instances charged to memcg, the admin can simply set max_user_instances to INT_MAX and let the memcg limits of the jobs limit their inotify instances. Link: https://lore.kernel.org/r/20201220044608.1258123-1-shakeelb@google.com Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Shakeel Butt <shakeelb@google.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
36bbbd0e23
commit
ac7b79fd19
4 changed files with 24 additions and 8 deletions
|
@ -470,6 +470,7 @@ static inline void fsnotify_update_flags(struct dentry *dentry)
|
|||
|
||||
/* create a new group */
|
||||
extern struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops);
|
||||
extern struct fsnotify_group *fsnotify_alloc_user_group(const struct fsnotify_ops *ops);
|
||||
/* get reference to a group */
|
||||
extern void fsnotify_get_group(struct fsnotify_group *group);
|
||||
/* drop reference on a group from fsnotify_alloc_group */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue