public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [REGRESSION] PAGE_ALIGN(): correctly handle ... breaks AVR32 build
@ 2008-07-25  0:41 Ben Nizette
  2008-07-25 10:28 ` [PATCH] Uninline arch_pick_mmap_layout Haavard Skinnemoen
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Nizette @ 2008-07-25  0:41 UTC (permalink / raw)
  To: righi.andrea; +Cc: Haavard Skinnemoen, kernel, linux-kernel


As of

commit 27ac792ca0b0a1e7e65f20342260650516c95864
Author: Andrea Righi <righi.andrea@gmail.com>
Date:   Wed Jul 23 21:28:13 2008 -0700

    PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures

We no longer have PAGE_ALIGN in asm-avr32/page.h so the AVR32 build dies
quite quickly:

  CC      init/main.o
In file included from include/linux/utsname.h:35,
                 from init/main.c:20:
include/linux/sched.h: In function 'arch_pick_mmap_layout':
include/linux/sched.h:2149: error: implicit declaration of function 'PAGE_ALIGN'
make[1]: *** [init/main.o] Error 1
make: *** [init] Error 2

This looks a relatively simple fix, just include linux/mm.h from
asm-avr32/processor.h from where sched.h gets the dodgy macro.
Unfortunately this, and every other placement of an #include
<linux/mm.h> I've tried, ends up in Massive Include Armageddon as per
[1].

Ideas?

Thanks,
	--Ben.

[1] http://niasdigital.com/bnizette/logs/MIA-25-7-8.log


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Uninline arch_pick_mmap_layout
  2008-07-25  0:41 [REGRESSION] PAGE_ALIGN(): correctly handle ... breaks AVR32 build Ben Nizette
@ 2008-07-25 10:28 ` Haavard Skinnemoen
  2008-07-25 10:39   ` Haavard Skinnemoen
  0 siblings, 1 reply; 3+ messages in thread
From: Haavard Skinnemoen @ 2008-07-25 10:28 UTC (permalink / raw)
  To: Ben Nizette; +Cc: righi.andrea, kernel, linux-kernel, akpm, Haavard Skinnemoen

As reported by Ben Nizette:

> We no longer have PAGE_ALIGN in asm-avr32/page.h so the AVR32 build dies
> quite quickly:
>
>   CC      init/main.o
> In file included from include/linux/utsname.h:35,
>                  from init/main.c:20:
> include/linux/sched.h: In function 'arch_pick_mmap_layout':
> include/linux/sched.h:2149: error: implicit declaration of function 'PAGE_ALIGN'
> make[1]: *** [init/main.o] Error 1
> make: *** [init] Error 2
>
> This looks a relatively simple fix, just include linux/mm.h from
> asm-avr32/processor.h from where sched.h gets the dodgy macro.
> Unfortunately this, and every other placement of an #include
> <linux/mm.h> I've tried, ends up in Massive Include Armageddon

So instead of shuffling includes around, just move the definition of
arch_pick_mmap_layout() into fs/exec.c. Some architectures, e.g. x86,
already define it out-of-line.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
---
 fs/exec.c             |    9 +++++++++
 include/linux/sched.h |    9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 190ed1f..b6e7c9a 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -74,6 +74,15 @@ int suid_dumpable = 0;
 static LIST_HEAD(formats);
 static DEFINE_RWLOCK(binfmt_lock);
 
+#ifndef HAVE_ARCH_PICK_MMAP_LAYOUT
+void arch_pick_mmap_layout(struct mm_struct *mm)
+{
+	mm->mmap_base = TASK_UNMAPPED_BASE;
+	mm->get_unmapped_area = arch_get_unmapped_area;
+	mm->unmap_area = arch_unmap_area;
+}
+#endif
+
 int register_binfmt(struct linux_binfmt * fmt)
 {
 	if (!fmt)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6aca4a1..9584278 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2141,16 +2141,7 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
 
 #endif /* CONFIG_SMP */
 
-#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
 extern void arch_pick_mmap_layout(struct mm_struct *mm);
-#else
-static inline void arch_pick_mmap_layout(struct mm_struct *mm)
-{
-	mm->mmap_base = TASK_UNMAPPED_BASE;
-	mm->get_unmapped_area = arch_get_unmapped_area;
-	mm->unmap_area = arch_unmap_area;
-}
-#endif
 
 #ifdef CONFIG_TRACING
 extern void
-- 
1.5.6.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Uninline arch_pick_mmap_layout
  2008-07-25 10:28 ` [PATCH] Uninline arch_pick_mmap_layout Haavard Skinnemoen
@ 2008-07-25 10:39   ` Haavard Skinnemoen
  0 siblings, 0 replies; 3+ messages in thread
From: Haavard Skinnemoen @ 2008-07-25 10:39 UTC (permalink / raw)
  To: akpm; +Cc: Ben Nizette, righi.andrea, kernel, linux-kernel, David Brownell

On Fri, 25 Jul 2008 12:28:02 +0200
Haavard Skinnemoen <haavard.skinnemoen@atmel.com> wrote:

> So instead of shuffling includes around, just move the definition of
> arch_pick_mmap_layout() into fs/exec.c. Some architectures, e.g. x86,
> already define it out-of-line.
> 
> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>

Heh, ok. So we have four patches fixing this regression now. I didn't
read all my mail before posting; sorry about that.

The patches which have already been added to -mm look essentially
identical to mine, so feel free to ignore my patch.

Haavard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-25 10:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-25  0:41 [REGRESSION] PAGE_ALIGN(): correctly handle ... breaks AVR32 build Ben Nizette
2008-07-25 10:28 ` [PATCH] Uninline arch_pick_mmap_layout Haavard Skinnemoen
2008-07-25 10:39   ` Haavard Skinnemoen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox