From: Suren Baghdasaryan <surenb@google.com>
To: gregkh@linuxfoundation.org
Cc: tj@kernel.org, lizefan@huawei.com, hannes@cmpxchg.org,
axboe@kernel.dk, dennis@kernel.org, dennisszhou@gmail.com,
mingo@redhat.com, peterz@infradead.org,
akpm@linux-foundation.org, corbet@lwn.net,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@android.com, Suren Baghdasaryan <surenb@google.com>
Subject: [PATCH v5 6/7] refactor header includes to allow kthread.h inclusion in psi_types.h
Date: Fri, 8 Mar 2019 10:43:10 -0800 [thread overview]
Message-ID: <20190308184311.144521-7-surenb@google.com> (raw)
In-Reply-To: <20190308184311.144521-1-surenb@google.com>
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: Suren Baghdasaryan <surenb@google.com>
---
include/linux/kthread.h | 3 ++-
include/linux/sched.h | 1 -
kernel/kthread.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 2c89e60bc752..0f9da966934e 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -4,7 +4,6 @@
/* Simple interface for creating and stopping kernel threads without mess. */
#include <linux/err.h>
#include <linux/sched.h>
-#include <linux/cgroup.h>
__printf(4, 5)
struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
@@ -198,6 +197,8 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work);
void kthread_destroy_worker(struct kthread_worker *worker);
+struct cgroup_subsys_state;
+
#ifdef CONFIG_BLK_CGROUP
void kthread_associate_blkcg(struct cgroup_subsys_state *css);
struct cgroup_subsys_state *kthread_blkcg(void);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1549584a1538..20b9f03399a7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -26,7 +26,6 @@
#include <linux/latencytop.h>
#include <linux/sched/prio.h>
#include <linux/signal_types.h>
-#include <linux/psi_types.h>
#include <linux/mm_types_task.h>
#include <linux/task_io_accounting.h>
#include <linux/rseq.h>
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 5942eeafb9ac..be4e8795561a 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -11,6 +11,7 @@
#include <linux/kthread.h>
#include <linux/completion.h>
#include <linux/err.h>
+#include <linux/cgroup.h>
#include <linux/cpuset.h>
#include <linux/unistd.h>
#include <linux/file.h>
--
2.21.0.360.g471c308f928-goog
next prev parent reply other threads:[~2019-03-08 18:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 18:43 [PATCH v5 0/7] psi: pressure stall monitors v5 Suren Baghdasaryan
2019-03-08 18:43 ` [PATCH v5 1/7] psi: introduce state_mask to represent stalled psi states Suren Baghdasaryan
2019-03-08 18:43 ` [PATCH v5 2/7] psi: make psi_enable static Suren Baghdasaryan
2019-03-08 18:43 ` [PATCH v5 3/7] psi: rename psi fields in preparation for psi trigger addition Suren Baghdasaryan
2019-03-08 18:43 ` [PATCH v5 4/7] psi: split update_stats into parts Suren Baghdasaryan
2019-03-08 18:43 ` [PATCH v5 5/7] psi: track changed states Suren Baghdasaryan
2019-03-08 18:43 ` Suren Baghdasaryan [this message]
2019-03-09 20:49 ` [PATCH v5 6/7] refactor header includes to allow kthread.h inclusion in psi_types.h kbuild test robot
2019-03-09 23:12 ` kbuild test robot
2019-03-08 18:43 ` [PATCH v5 7/7] psi: introduce psi monitor Suren Baghdasaryan
2019-03-19 22:51 ` [PATCH v5 0/7] psi: pressure stall monitors v5 Minchan Kim
2019-03-20 0:03 ` Suren Baghdasaryan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190308184311.144521-7-surenb@google.com \
--to=surenb@google.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=dennis@kernel.org \
--cc=dennisszhou@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@android.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan@huawei.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).