ULMK has been observed to get stuck waiting for mutexes held by processes in direct reclaim for many seconds. rwsem_down_read_failed_killable+0x20 down_read_killable+0xa8 __access_remote_vm+0x54 access_remote_vm+0x48 proc_pid_cmdline_read+0xe0 __vfs_read+0x54 vfs_read+0xa4 __arm64_sys_pread64+0x80 el0_svc_common+0xac el0_svc_handler+0x7c el0_svc+0x8 To resolve these deadlocks, allow the oom-killer to run when a low memory situtation is detected. One side effect of running the oom-killer is that it may make it more difficult to detect issues with ULMK. Therefore on debug builds, attempt to detect whether ULMK is stuck using a watchdog timer mechanism, as opposed to running, but deciding not to issue a kill. Change-Id: If1d629e1553c3562b3d23442abffc2faedb31ba2 Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
72 lines
1.7 KiB
C
72 lines
1.7 KiB
C
#ifndef _LINUX_PSI_H
|
|
#define _LINUX_PSI_H
|
|
|
|
#include <linux/jump_label.h>
|
|
#include <linux/psi_types.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/poll.h>
|
|
|
|
struct seq_file;
|
|
struct css_set;
|
|
|
|
#ifdef CONFIG_PSI
|
|
|
|
extern struct static_key_false psi_disabled;
|
|
|
|
void psi_init(void);
|
|
|
|
void psi_task_change(struct task_struct *task, int clear, int set);
|
|
|
|
void psi_memstall_tick(struct task_struct *task, int cpu);
|
|
void psi_memstall_enter(unsigned long *flags);
|
|
void psi_memstall_leave(unsigned long *flags);
|
|
|
|
int psi_show(struct seq_file *s, struct psi_group *group, enum psi_res res);
|
|
|
|
void psi_emergency_trigger(void);
|
|
bool psi_is_trigger_active(void);
|
|
|
|
#ifdef CONFIG_CGROUPS
|
|
int psi_cgroup_alloc(struct cgroup *cgrp);
|
|
void psi_cgroup_free(struct cgroup *cgrp);
|
|
void cgroup_move_task(struct task_struct *p, struct css_set *to);
|
|
|
|
struct psi_trigger *psi_trigger_create(struct psi_group *group,
|
|
char *buf, size_t nbytes, enum psi_res res);
|
|
void psi_trigger_replace(void **trigger_ptr, struct psi_trigger *t);
|
|
|
|
__poll_t psi_trigger_poll(void **trigger_ptr, struct file *file,
|
|
poll_table *wait);
|
|
#endif
|
|
|
|
#else /* CONFIG_PSI */
|
|
|
|
static inline void psi_init(void) {}
|
|
|
|
static inline void psi_memstall_enter(unsigned long *flags) {}
|
|
static inline void psi_memstall_leave(unsigned long *flags) {}
|
|
|
|
static inline void psi_emergency_trigger(void){}
|
|
static inline bool psi_is_trigger_active(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
#ifdef CONFIG_CGROUPS
|
|
static inline int psi_cgroup_alloc(struct cgroup *cgrp)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void psi_cgroup_free(struct cgroup *cgrp)
|
|
{
|
|
}
|
|
static inline void cgroup_move_task(struct task_struct *p, struct css_set *to)
|
|
{
|
|
rcu_assign_pointer(p->cgroups, to);
|
|
}
|
|
#endif
|
|
|
|
#endif /* CONFIG_PSI */
|
|
|
|
#endif /* _LINUX_PSI_H */
|