diff options
author | Tejun Heo <tj@kernel.org> | 2018-04-26 14:29:04 -0700 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2018-04-26 14:29:04 -0700 |
commit | b12e35832805bf120819b83d8fdb6e4d227a5ddb (patch) | |
tree | 87b6b3697fded167ad801db2f8fd654815ec8016 /include/linux/cgroup-defs.h | |
parent | 5faaf05f2976fd9ec0ecd582bcfb3a41cde4c65e (diff) | |
download | talos-obmc-linux-b12e35832805bf120819b83d8fdb6e4d227a5ddb.tar.gz talos-obmc-linux-b12e35832805bf120819b83d8fdb6e4d227a5ddb.zip |
cgroup: Limit event generation frequency
".events" files generate file modified event to notify userland of
possible new events. Some of the events can be quite bursty
(e.g. memory high event) and generating notification each time is
costly and pointless.
This patch implements a event rate limit mechanism. If a new
notification is requested before 10ms has passed since the previous
notification, the new notification is delayed till then.
As this only delays from the second notification on in a given close
cluster of notifications, userland reactions to notifications
shouldn't be delayed at all in most cases while avoiding notification
storms.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup-defs.h')
-rw-r--r-- | include/linux/cgroup-defs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index dc5b70449dc6..133531fcfb33 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -105,6 +105,8 @@ enum { struct cgroup_file { /* do not access any fields from outside cgroup core */ struct kernfs_node *kn; + unsigned long notified_at; + struct timer_list notify_timer; }; /* |