at v4.20-rc2 53 lines 1.2 kB view raw
1#ifndef _LINUX_PSI_H 2#define _LINUX_PSI_H 3 4#include <linux/psi_types.h> 5#include <linux/sched.h> 6 7struct seq_file; 8struct css_set; 9 10#ifdef CONFIG_PSI 11 12extern bool psi_disabled; 13 14void psi_init(void); 15 16void psi_task_change(struct task_struct *task, int clear, int set); 17 18void psi_memstall_tick(struct task_struct *task, int cpu); 19void psi_memstall_enter(unsigned long *flags); 20void psi_memstall_leave(unsigned long *flags); 21 22int psi_show(struct seq_file *s, struct psi_group *group, enum psi_res res); 23 24#ifdef CONFIG_CGROUPS 25int psi_cgroup_alloc(struct cgroup *cgrp); 26void psi_cgroup_free(struct cgroup *cgrp); 27void cgroup_move_task(struct task_struct *p, struct css_set *to); 28#endif 29 30#else /* CONFIG_PSI */ 31 32static inline void psi_init(void) {} 33 34static inline void psi_memstall_enter(unsigned long *flags) {} 35static inline void psi_memstall_leave(unsigned long *flags) {} 36 37#ifdef CONFIG_CGROUPS 38static inline int psi_cgroup_alloc(struct cgroup *cgrp) 39{ 40 return 0; 41} 42static inline void psi_cgroup_free(struct cgroup *cgrp) 43{ 44} 45static inline void cgroup_move_task(struct task_struct *p, struct css_set *to) 46{ 47 rcu_assign_pointer(p->cgroups, to); 48} 49#endif 50 51#endif /* CONFIG_PSI */ 52 53#endif /* _LINUX_PSI_H */