public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Carmeli Tamir <carmeli.tamir@gmail.com>
Cc: mingo@redhat.com, peterz@infradead.org,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] scheduler: wait: Added missing include freezer.h
Date: Mon, 29 Oct 2018 07:01:53 +0100	[thread overview]
Message-ID: <20181029060153.GA128403@gmail.com> (raw)
In-Reply-To: <1540582551-44028-1-git-send-email-carmeli.tamir@gmail.com>


* 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

      reply	other threads:[~2018-10-29  6:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 19:35 [PATCH] scheduler: wait: Added missing include freezer.h Carmeli Tamir
2018-10-29  6:01 ` Ingo Molnar [this message]

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=20181029060153.GA128403@gmail.com \
    --to=mingo@kernel.org \
    --cc=carmeli.tamir@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rjw@sisk.pl \
    --cc=tglx@linutronix.de \
    --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