lkml.org 
[lkml]   [2019]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: fix potential build error in compaction.h
On Tue 12-02-19 16:38:58, Yu Zhao wrote:
> On Tue, Feb 12, 2019 at 01:03:58PM +0100, Michal Hocko wrote:
> > On Fri 08-02-19 01:04:37, Yu Zhao wrote:
> > > Declaration of struct node is required regardless. On UMA system,
> > > including compaction.h without proceeding node.h shouldn't cause
> > > build error.
> >
> > Anybody requiring struct node shouldn't depend on compaction.h to get
> > the declaration.
>
> Yes, but the problem is the other way around. Build error happens
> when somebody includes compaction.h without definition or
> declaration of struct node, if CONFIG_NUMA is not set.
>
> compaction.h already has struct node declaration to avoid the error
> when CONFIG_NUMA is set, but we need it for both cases.
>
> > Anyway have you seen an actual build breakage?
>
> Yes. I ran into the problem while trying to include compaction.h
> in this order, and had to move it to the bottom as a workaround.
>
> #include <linux/backing-dev.h>
> #include <linux/compaction.h>
> #include <linux/ctype.h>
> #include <linux/freezer.h>
> #include <linux/hugetlb.h>
> #include <linux/kstaled.h>
> #include <linux/kthread.h>
> #include <linux/mm_inline.h>
> #include <linux/mm_types.h>
> #include <linux/module.h>
> #include <linux/pagemap.h>
> #include <linux/sched/task_stack.h>
> #include <linux/swap.h>

OK, fair enough. A subtle header file ordering dependencies are PITA.

Acked-by: Michal Hocko <mhocko@suse.com>

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2019-02-13 14:01    [W:0.051 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site