• S
    psi: introduce psi monitor · f0afe96b
    Suren Baghdasaryan 提交于
    commit 0e94682b73bfa6c44c98af7a26771c9c08c055d5 upstream.
    
    Psi monitor aims to provide a low-latency short-term pressure detection
    mechanism configurable by users.  It allows users to monitor psi metrics
    growth and trigger events whenever a metric raises above user-defined
    threshold within user-defined time window.
    
    Time window and threshold are both expressed in usecs.  Multiple psi
    resources with different thresholds and window sizes can be monitored
    concurrently.
    
    Psi monitors activate when system enters stall state for the monitored
    psi metric and deactivate upon exit from the stall state.  While system
    is in the stall state psi signal growth is monitored at a rate of 10
    times per tracking window.  Min window size is 500ms, therefore the min
    monitoring interval is 50ms.  Max window size is 10s with monitoring
    interval of 1s.
    
    When activated psi monitor stays active for at least the duration of one
    tracking window to avoid repeated activations/deactivations when psi
    signal is bouncing.
    
    Notifications to the users are rate-limited to one per tracking window.
    
    Link: http://lkml.kernel.org/r/20190319235619.260832-8-surenb@google.comSigned-off-by: NSuren Baghdasaryan <surenb@google.com>
    Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
    Cc: Dennis Zhou <dennis@kernel.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jens Axboe <axboe@kernel.dk>
    Cc: Li Zefan <lizefan@huawei.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Tejun Heo <tj@kernel.org>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
    Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
    f0afe96b
cgroup.c 162.6 KB