LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] scheduler: wait: Added missing include freezer.h
@ 2018-10-26 19:35 Carmeli Tamir
2018-10-29 6:01 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Carmeli Tamir @ 2018-10-26 19:35 UTC (permalink / raw)
To: mingo, peterz, linux-kernel; +Cc: carmeli.tamir
The function 'wait_event_freezable' calls '__wait_event_freezable' that
uses 'try_to_freeze', which is defined in freezer.h.
This causes a compilation error for callers of 'wait_event_freezables',
forcing them to include also freezer.h.
Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com>
---
include/linux/wait.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index ed7c122..75061ee 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -4,6 +4,7 @@
/*
* Linux wait queue related types and methods
*/
+#include <linux/freezer.h>
#include <linux/list.h>
#include <linux/stddef.h>
#include <linux/spinlock.h>
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] scheduler: wait: Added missing include freezer.h
2018-10-26 19:35 [PATCH] scheduler: wait: Added missing include freezer.h Carmeli Tamir
@ 2018-10-29 6:01 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2018-10-29 6:01 UTC (permalink / raw)
To: Carmeli Tamir
Cc: mingo, peterz, linux-kernel, Thomas Gleixner, Rafael J. Wysocki,
Tejun Heo
* Carmeli Tamir <carmeli.tamir@gmail.com> wrote:
> The function 'wait_event_freezable' calls '__wait_event_freezable' that
> uses 'try_to_freeze', which is defined in freezer.h.
> This causes a compilation error for callers of 'wait_event_freezables',
> forcing them to include also freezer.h.
>
> Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com>
> ---
> include/linux/wait.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/wait.h b/include/linux/wait.h
> index ed7c122..75061ee 100644
> --- a/include/linux/wait.h
> +++ b/include/linux/wait.h
> @@ -4,6 +4,7 @@
> /*
> * Linux wait queue related types and methods
> */
> +#include <linux/freezer.h>
> #include <linux/list.h>
> #include <linux/stddef.h>
> #include <linux/spinlock.h>
I don't think we should do this, because freezer.h then includes
<linux/sched.h> - while much of the point of <linux/wait.h> was to not
include the huge chain of dependencies that sched.h invokes...
BTW., another way this could be solved is to uninline try_to_freeze(), it
seems a bit large at first sight to be inlined - but I could be wrong.
Once it's not inline we could just add this to wait.h:
extern bool try_to_freeze(void);
or so. This decouples wait.h from freezer.h.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-29 6:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 19:35 [PATCH] scheduler: wait: Added missing include freezer.h Carmeli Tamir
2018-10-29 6:01 ` Ingo Molnar
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).