Signed-off-by: Liu Xinpeng liuxp11@chinatelecom.cn Signed-off-by: Ctyun Kernel ctyuncommiter01@chinatelecom.cn --- include/linux/cgroup-defs.h | 4 ++++ include/linux/delayacct.h | 4 ++++ include/linux/kernfs.h | 2 ++ include/linux/kthread.h | 3 +++ include/linux/psi.h | 2 ++ include/linux/sched.h | 4 ++-- include/uapi/linux/taskstats.h | 2 ++ kernel/kthread.c | 2 ++ mm/filemap.c | 2 ++ 9 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 454ea4f..16f7801 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -444,8 +444,10 @@ struct cgroup { /* used to schedule release agent */ struct work_struct release_agent_work;
+#ifndef __GENKSYMS__ /* used to track pressure stalls */ struct psi_group psi; +#endif
/* used to store eBPF programs */ struct cgroup_bpf bpf; @@ -580,8 +582,10 @@ struct cftype { ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off);
+#ifndef __GENKSYMS__ __poll_t (*poll)(struct kernfs_open_file *of, struct poll_table_struct *pt); +#endif
#ifdef CONFIG_DEBUG_LOCK_ALLOC struct lock_class_key lockdep_key; diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 577d1b2..d76f251 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h @@ -58,11 +58,15 @@ struct task_delay_info { u64 freepages_start; u64 freepages_delay; /* wait for memory reclaim */
+#ifndef __GENKSYMS__ u64 thrashing_start; u64 thrashing_delay; /* wait for thrashing page */ +#endif
u32 freepages_count; /* total count of memory reclaim */ +#ifndef __GENKSYMS__ u32 thrashing_count; /* total count of thrash waits */ +#endif }; #endif
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index ab81a22..f9ef22d 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -269,8 +269,10 @@ struct kernfs_ops { ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes, loff_t off);
+#ifndef __GENKSYMS__ __poll_t (*poll)(struct kernfs_open_file *of, struct poll_table_struct *pt); +#endif
int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma);
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 206f0c3..de1b645 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -4,6 +4,9 @@ /* Simple interface for creating and stopping kernel threads without mess. */ #include <linux/err.h> #include <linux/sched.h> +#ifdef __GENKSYMS__ +#include <linux/cgroup.h> +#endif
__printf(4, 5) struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), diff --git a/include/linux/psi.h b/include/linux/psi.h index 7b3de73..2ba72320 100644 --- a/include/linux/psi.h +++ b/include/linux/psi.h @@ -4,7 +4,9 @@ #include <linux/jump_label.h> #include <linux/psi_types.h> #include <linux/sched.h> +#ifndef __GENKSYMS__ #include <linux/poll.h> +#endif
struct seq_file; struct css_set; diff --git a/include/linux/sched.h b/include/linux/sched.h index b68456e..9a3a5b5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -715,7 +715,7 @@ struct task_struct { unsigned sched_contributes_to_load:1; unsigned sched_migrated:1; unsigned sched_remote_wakeup:1; -#ifdef CONFIG_PSI +#if (defined(CONFIG_PSI) && !defined(__GENKSYMS__)) unsigned sched_psi_wake_requeue:1; #endif
@@ -972,7 +972,7 @@ struct task_struct { siginfo_t *last_siginfo;
struct task_io_accounting ioac; -#ifdef CONFIG_PSI +#if (defined(CONFIG_PSI) && !defined(__GENKSYMS__)) /* Pressure stall state */ unsigned int psi_flags; #endif diff --git a/include/uapi/linux/taskstats.h b/include/uapi/linux/taskstats.h index 5e8ca16..51d6fae 100644 --- a/include/uapi/linux/taskstats.h +++ b/include/uapi/linux/taskstats.h @@ -165,9 +165,11 @@ struct taskstats { __u64 freepages_count; __u64 freepages_delay_total;
+#ifndef __GENKSYMS__ /* Delay waiting for thrashing page */ __u64 thrashing_count; __u64 thrashing_delay_total; +#endif };
diff --git a/kernel/kthread.c b/kernel/kthread.c index 2ec3583..0c857a7 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -11,7 +11,9 @@ #include <linux/kthread.h> #include <linux/completion.h> #include <linux/err.h> +#ifndef __GENKSYMS__ #include <linux/cgroup.h> +#endif #include <linux/cpuset.h> #include <linux/unistd.h> #include <linux/file.h> diff --git a/mm/filemap.c b/mm/filemap.c index 94f7f38..0177ace 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -36,7 +36,9 @@ #include <linux/cleancache.h> #include <linux/shmem_fs.h> #include <linux/rmap.h> +#ifndef __GENKSYMS__ #include <linux/delayacct.h> +#endif #include <linux/psi.h> #include "internal.h"