Expand description
A single inotify instance which watches the memory events files of all containers.
Structsยง
- Shared
Watcher ๐ - A single inotify instance shared by all OOM watchers.
- Subscription ๐
- A subscription to the
SharedWatcherwhich unsubscribes on drop. - Watch ๐
- A watch of a file and its subscribers.
- Watch
Event ๐ - A watch event as delivered to subscribers.
- Watches ๐
- The watches by descriptor. A watch belongs to a file rather than to its path: a file which got recreated gets a watch of its own, and the events of the old one, like its removal, must not reach the subscribers of the new one.
Constantsยง
- MIN_
DISPATCH_ ๐INTERVAL - How often the events get dispatched at most. The kernel notifies a change
of the memory events of a cgroup up to every 10 ms, and one of the
hierarchical ones of every ancestor, which alternate in the queue, so
that inotify does not merge them. Under memory pressure, like at
memory.highormemory.max, a single container would wake the server up to a hundred times a second otherwise, and every one of its watchers would read its counters as often. The queue of the kernel holds 16384 events by default, which takes more than 1600 watched files changing in one interval, far more than the containers of a pod. An overflow gets dispatched to every watcher, seeWatches::dispatch. - WATCH_
FLAGS ๐ - What a watch reports. cgroupfs notifies a change of the memory events
with
IN_MODIFYand the removal of a cgroup withIN_IGNOREDonly, which every watch gets anyway.
Staticsยง
- SHARED_
WATCHER ๐ - The shared watcher is kept alive by its subscriptions. It gets created on the first subscription and dropped with the last one, which frees the inotify instance while no container is watched. A failed creation is retried on the next subscription instead of being cached, and so is a watcher whose reader stopped. The server has a single runtime, which reads the events.
Type Aliasesยง
- Slot ๐
- Where the shared watcher is kept, see
SharedWatcher::get.