Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c405bfbb authored by Suren Baghdasaryan's avatar Suren Baghdasaryan
Browse files

FROMLIST: refactor header includes to allow kthread.h inclusion in psi_types.h



kthread.h can't be included in psi_types.h because it creates a circular
inclusion with kthread.h eventually including psi_types.h and complaining
on kthread structures not being defined because they are defined further
in the kthread.h. Resolve this by removing psi_types.h inclusion from the
headers included from kthread.h.

Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>

(not upstream yet, latest version published at: https://lore.kernel.org/patchwork/patch/1052417/

)

Conflicts:
        include/linux/kthread.h
        kernel/kthread.c

(1. <linux/cgroup.h> include is already missing in kthread.h
2. <linux/cgroup.h> is already included in kthread.c
3. include <linux/cgroup-defs.h> in psi.h
4. move <linux/cgroup-defs.h> include from sched.h into core.c
5. move threadgroup_change_begin and threadgroup_change_end implementations
from sched.h into core.c)

Bug: 127712811
Bug: 129157727
Test: lmkd in PSI mode
Change-Id: I07c1f4fddf0c43b3095f505e062d9d179d041544
Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
parent 889171bf
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,7 @@
#include <linux/jump_label.h>
#include <linux/jump_label.h>
#include <linux/psi_types.h>
#include <linux/psi_types.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/cgroup-defs.h>


struct seq_file;
struct seq_file;
struct css_set;
struct css_set;
+2 −11
Original line number Original line Diff line number Diff line
@@ -51,7 +51,6 @@ struct sched_param {
#include <linux/timer.h>
#include <linux/timer.h>
#include <linux/hrtimer.h>
#include <linux/hrtimer.h>
#include <linux/kcov.h>
#include <linux/kcov.h>
#include <linux/psi_types.h>
#include <linux/task_io_accounting.h>
#include <linux/task_io_accounting.h>
#include <linux/latencytop.h>
#include <linux/latencytop.h>
#include <linux/cred.h>
#include <linux/cred.h>
@@ -59,7 +58,6 @@ struct sched_param {
#include <linux/uidgid.h>
#include <linux/uidgid.h>
#include <linux/gfp.h>
#include <linux/gfp.h>
#include <linux/magic.h>
#include <linux/magic.h>
#include <linux/cgroup-defs.h>


#include <asm/processor.h>
#include <asm/processor.h>


@@ -3245,11 +3243,7 @@ static inline void unlock_task_sighand(struct task_struct *tsk,
 * subsystems needing threadgroup stability can hook into for
 * subsystems needing threadgroup stability can hook into for
 * synchronization.
 * synchronization.
 */
 */
static inline void threadgroup_change_begin(struct task_struct *tsk)
extern void threadgroup_change_begin(struct task_struct *tsk);
{
	might_sleep();
	cgroup_threadgroup_change_begin(tsk);
}


/**
/**
 * threadgroup_change_end - mark the end of changes to a threadgroup
 * threadgroup_change_end - mark the end of changes to a threadgroup
@@ -3257,10 +3251,7 @@ static inline void threadgroup_change_begin(struct task_struct *tsk)
 *
 *
 * See threadgroup_change_begin().
 * See threadgroup_change_begin().
 */
 */
static inline void threadgroup_change_end(struct task_struct *tsk)
extern void threadgroup_change_end(struct task_struct *tsk);
{
	cgroup_threadgroup_change_end(tsk);
}


#ifdef CONFIG_THREAD_INFO_IN_TASK
#ifdef CONFIG_THREAD_INFO_IN_TASK


+12 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@
#include <linux/prefetch.h>
#include <linux/prefetch.h>
#include <linux/cpufreq_times.h>
#include <linux/cpufreq_times.h>
#include <linux/sched/loadavg.h>
#include <linux/sched/loadavg.h>
#include <linux/cgroup-defs.h>


#include <asm/switch_to.h>
#include <asm/switch_to.h>
#include <asm/tlb.h>
#include <asm/tlb.h>
@@ -8588,6 +8589,17 @@ static inline struct task_group *css_tg(struct cgroup_subsys_state *css)
	return css ? container_of(css, struct task_group, css) : NULL;
	return css ? container_of(css, struct task_group, css) : NULL;
}
}


void threadgroup_change_begin(struct task_struct *tsk)
{
	might_sleep();
	cgroup_threadgroup_change_begin(tsk);
}

void threadgroup_change_end(struct task_struct *tsk)
{
	cgroup_threadgroup_change_end(tsk);
}

static struct cgroup_subsys_state *
static struct cgroup_subsys_state *
cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
{
{