Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-07 Thread Kevin Hilman
Hi Andrew,

On Wed, Apr 1, 2015 at 2:54 PM, Kevin Hilman khil...@kernel.org wrote:
 Andrew Morton a...@linux-foundation.org writes:

 On Wed, 01 Apr 2015 10:47:49 +0100 Marc Zyngier marc.zyng...@arm.com wrote:

  -static int unmap_and_move(new_page_t get_new_page, free_page_t 
  put_new_page,
  -  unsigned long private, struct page *page, int force,
  -  enum migrate_mode mode)
  +static noinline int unmap_and_move(new_page_t get_new_page,
  + free_page_t put_new_page,
  + unsigned long private, struct page *page,
  + int force, enum migrate_mode mode)
   {
 int rc = 0;
 int *result = NULL;
 

 Ouch. That's really ugly. And on 32bit ARM, we end-up spilling half of
 the parameters on the stack, which is not going to help performance
 either (not that this would be useful on 32bit ARM anyway...).

 Any chance you could make this dependent on some compiler detection
 mechanism?

 With my arm compiler (gcc-4.4.4) the patch makes no difference -
 unmap_and_move() isn't being inlined anyway.

 How does this look?

 Kevin, could you please retest?  I might have fat-fingered something...

 Your patch on top of Geert's still compiles fine for me with gcc-4.7.3.
 However, I'm not sure how specific we can be on the versions.

 /me goes to test a few more compilers...   OK...

 ICE: 4.7.1, 4.7.3, 4.8.3
 OK: 4.6.3, 4.9.2, 4.9.3

 The diff below[2] on top of yours compiles fine here and at least covers
 the compilers I *know* to trigger the ICE.

I see my fix in your mmots since last Thurs (4/2), but it's not in
mmotm (last updated today) so today's linux-next still has the ICE for
anything other than gcc-4.7.3.   Just checking to see when you plan to
update mmotm.

Thanks,

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-07 Thread Andrew Morton
On Tue, 7 Apr 2015 10:57:52 -0700 Kevin Hilman khil...@kernel.org wrote:

  The diff below[2] on top of yours compiles fine here and at least covers
  the compilers I *know* to trigger the ICE.
 
 I see my fix in your mmots since last Thurs (4/2), but it's not in
 mmotm (last updated today) so today's linux-next still has the ICE for
 anything other than gcc-4.7.3.   Just checking to see when you plan to
 update mmotm.

It should all be there today?
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-07 Thread Kevin Hilman
Andrew Morton a...@linux-foundation.org writes:

 On Tue, 7 Apr 2015 10:57:52 -0700 Kevin Hilman khil...@kernel.org wrote:

  The diff below[2] on top of yours compiles fine here and at least covers
  the compilers I *know* to trigger the ICE.
 
 I see my fix in your mmots since last Thurs (4/2), but it's not in
 mmotm (last updated today) so today's linux-next still has the ICE for
 anything other than gcc-4.7.3.   Just checking to see when you plan to
 update mmotm.

 It should all be there today?

Nope.  

In mmotm, only the original patch plus your first fix is there:

$ curl -sO http://www.ozlabs.org/~akpm/mmotm/broken-out.tar.gz
$ tar -tavf broken-out.tar.gz |grep gcc-473
-rw-r- akpm/eng   1838 2015-04-01 14:41 
broken-out/mm-migrate-mark-unmap_and_move-noinline-to-avoid-ice-in-gcc-473.patch
-rw-r- akpm/eng   1309 2015-04-01 14:41 
broken-out/mm-migrate-mark-unmap_and_move-noinline-to-avoid-ice-in-gcc-473-fix.patch

but in mmots, the additional ptch from me, plus another comment fixup
from you are also there:

$ curl -sO http://www.ozlabs.org/~akpm/mmots/broken-out.tar.gz
$ tar -tavf broken-out.tar.gz |grep gcc-473
-rw-r- akpm/eng   1882 2015-04-06 16:24 
broken-out/mm-migrate-mark-unmap_and_move-noinline-to-avoid-ice-in-gcc-473.patch
-rw-r- akpm/eng   1271 2015-04-06 16:24 
broken-out/mm-migrate-mark-unmap_and_move-noinline-to-avoid-ice-in-gcc-473-fix.patch
-rw-r- akpm/eng   1382 2015-04-06 16:24 
broken-out/mm-migrate-mark-unmap_and_move-noinline-to-avoid-ice-in-gcc-473-fix-fix.patch
-rw-r- akpm/eng968 2015-04-06 16:24 
broken-out/mm-migrate-mark-unmap_and_move-noinline-to-avoid-ice-in-gcc-473-fix-fix-fix.patch


Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-07 Thread Andrew Morton
On Tue, 07 Apr 2015 15:41:32 -0700 Kevin Hilman khil...@kernel.org wrote:

 Andrew Morton a...@linux-foundation.org writes:
 
  On Tue, 7 Apr 2015 10:57:52 -0700 Kevin Hilman khil...@kernel.org wrote:
 
   The diff below[2] on top of yours compiles fine here and at least covers
   the compilers I *know* to trigger the ICE.
  
  I see my fix in your mmots since last Thurs (4/2), but it's not in
  mmotm (last updated today) so today's linux-next still has the ICE for
  anything other than gcc-4.7.3.   Just checking to see when you plan to
  update mmotm.
 
  It should all be there today?
 
 Nope.  

huh, I swear I did an mmotm yesterday.

Let me see if I can sort out the watchdog mess and produce something
releasable...
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-07 Thread Kevin Hilman
Andrew Morton a...@linux-foundation.org writes:

 On Tue, 07 Apr 2015 16:27:44 -0700 Kevin Hilman khil...@kernel.org wrote:

   It should all be there today?
  
  Nope.  
 
  huh, I swear I did an mmotm yesterday.
 
 Well, based on the timestamp of the mmotm dir on ozlabs, it appears you
 did.  That's why I was confused why the gcc-473 patches from mmots aren't
 there.

 Things look a bit better now.

Yup, I can confirm all 4 patches are there now.  Things should be in
good shape for the next -next.

Thanks,

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-07 Thread Kevin Hilman
Andrew Morton a...@linux-foundation.org writes:

 On Tue, 07 Apr 2015 15:41:32 -0700 Kevin Hilman khil...@kernel.org wrote:

 Andrew Morton a...@linux-foundation.org writes:
 
  On Tue, 7 Apr 2015 10:57:52 -0700 Kevin Hilman khil...@kernel.org wrote:
 
   The diff below[2] on top of yours compiles fine here and at least covers
   the compilers I *know* to trigger the ICE.
  
  I see my fix in your mmots since last Thurs (4/2), but it's not in
  mmotm (last updated today) so today's linux-next still has the ICE for
  anything other than gcc-4.7.3.   Just checking to see when you plan to
  update mmotm.
 
  It should all be there today?
 
 Nope.  

 huh, I swear I did an mmotm yesterday.

Well, based on the timestamp of the mmotm dir on ozlabs, it appears you
did.  That's why I was confused why the gcc-473 patches from mmots aren't
there.

 Let me see if I can sort out the watchdog mess and produce something
 releasable...

OK, thanks.

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-07 Thread Andrew Morton
On Tue, 07 Apr 2015 16:27:44 -0700 Kevin Hilman khil...@kernel.org wrote:

   It should all be there today?
  
  Nope.  
 
  huh, I swear I did an mmotm yesterday.
 
 Well, based on the timestamp of the mmotm dir on ozlabs, it appears you
 did.  That's why I was confused why the gcc-473 patches from mmots aren't
 there.

Things look a bit better now.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-02 Thread Geert Uytterhoeven
Hi Russell,

On Wed, Apr 1, 2015 at 11:59 PM, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:
 On Wed, Apr 01, 2015 at 02:54:59PM -0700, Kevin Hilman wrote:
 Your patch on top of Geert's still compiles fine for me with gcc-4.7.3.
 However, I'm not sure how specific we can be on the versions.

 /me goes to test a few more compilers...   OK...

 ICE: 4.7.1, 4.7.3, 4.8.3
 OK: 4.6.3, 4.9.2, 4.9.3

 The diff below[2] on top of yours compiles fine here and at least covers
 the compilers I *know* to trigger the ICE.

 Interesting.  I'm using stock gcc 4.7.4 here, though I'm not building
 -next (only mainline + my tree + arm-soc) and it hasn't shown a problem
 yet.

Mainline doesn't fail.

 I think we need to ask the question: is the bug in stock GCC or Linaro
 GCC?  If it's not in stock GCC, then it's a GCC vendor problem :)

Can you please try -next (e.g. next-20150320)?

make bockw_defconfig
make mm/migrate.o

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say programmer or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-02 Thread Kevin Hilman
On Thu, Apr 2, 2015 at 12:12 PM, Lina Iyer lina.i...@linaro.org wrote:
 On Wed, Apr 01 2015 at 15:57 -0600, Kevin Hilman wrote:

 Andrew Morton a...@linux-foundation.org writes:

 On Wed, 01 Apr 2015 10:47:49 +0100 Marc Zyngier marc.zyng...@arm.com
 wrote:

  -static int unmap_and_move(new_page_t get_new_page, free_page_t
  put_new_page,
  - unsigned long private, struct page *page, int
  force,
  - enum migrate_mode mode)
  +static noinline int unmap_and_move(new_page_t get_new_page,
  +free_page_t put_new_page,
  +unsigned long private, struct page
  *page,
  +int force, enum migrate_mode mode)
   {
int rc = 0;
int *result = NULL;
 

 Ouch. That's really ugly. And on 32bit ARM, we end-up spilling half of
 the parameters on the stack, which is not going to help performance
 either (not that this would be useful on 32bit ARM anyway...).

 Any chance you could make this dependent on some compiler detection
 mechanism?


 With my arm compiler (gcc-4.4.4) the patch makes no difference -
 unmap_and_move() isn't being inlined anyway.

 How does this look?

 Kevin, could you please retest?  I might have fat-fingered something...


 Your patch on top of Geert's still compiles fine for me with gcc-4.7.3.
 However, I'm not sure how specific we can be on the versions.

 /me goes to test a few more compilers...   OK...

 ICE: 4.7.1, 4.7.3, 4.8.3
 OK: 4.6.3, 4.9.2, 4.9.3

 The diff below[2] on top of yours compiles fine here and at least covers
 the compilers I *know* to trigger the ICE.


 I see ICE on arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.4-2ubuntu1) 4.7.4


Thanks for checking.  I'm assuming my patch fixes it for your since
that should catch any 4.7.x compiler.

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-02 Thread Lina Iyer

On Thu, Apr 02 2015 at 15:12 -0600, Kevin Hilman wrote:

On Thu, Apr 2, 2015 at 12:12 PM, Lina Iyer lina.i...@linaro.org wrote:

On Wed, Apr 01 2015 at 15:57 -0600, Kevin Hilman wrote:


Andrew Morton a...@linux-foundation.org writes:


On Wed, 01 Apr 2015 10:47:49 +0100 Marc Zyngier marc.zyng...@arm.com
wrote:


 -static int unmap_and_move(new_page_t get_new_page, free_page_t
 put_new_page,
 - unsigned long private, struct page *page, int
 force,
 - enum migrate_mode mode)
 +static noinline int unmap_and_move(new_page_t get_new_page,
 +free_page_t put_new_page,
 +unsigned long private, struct page
 *page,
 +int force, enum migrate_mode mode)
  {
   int rc = 0;
   int *result = NULL;


Ouch. That's really ugly. And on 32bit ARM, we end-up spilling half of
the parameters on the stack, which is not going to help performance
either (not that this would be useful on 32bit ARM anyway...).

Any chance you could make this dependent on some compiler detection
mechanism?



With my arm compiler (gcc-4.4.4) the patch makes no difference -
unmap_and_move() isn't being inlined anyway.

How does this look?

Kevin, could you please retest?  I might have fat-fingered something...



Your patch on top of Geert's still compiles fine for me with gcc-4.7.3.
However, I'm not sure how specific we can be on the versions.

/me goes to test a few more compilers...   OK...

ICE: 4.7.1, 4.7.3, 4.8.3
OK: 4.6.3, 4.9.2, 4.9.3

The diff below[2] on top of yours compiles fine here and at least covers
the compilers I *know* to trigger the ICE.



I see ICE on arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.4-2ubuntu1) 4.7.4



Thanks for checking.  I'm assuming my patch fixes it for your since
that should catch any 4.7.x compiler.


Yes, thank you. This fixes it on 4.7.4


Kevin

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-02 Thread Lina Iyer

On Wed, Apr 01 2015 at 15:57 -0600, Kevin Hilman wrote:

Andrew Morton a...@linux-foundation.org writes:


On Wed, 01 Apr 2015 10:47:49 +0100 Marc Zyngier marc.zyng...@arm.com wrote:


 -static int unmap_and_move(new_page_t get_new_page, free_page_t put_new_page,
 -  unsigned long private, struct page *page, int force,
 -  enum migrate_mode mode)
 +static noinline int unmap_and_move(new_page_t get_new_page,
 + free_page_t put_new_page,
 + unsigned long private, struct page *page,
 + int force, enum migrate_mode mode)
  {
int rc = 0;
int *result = NULL;


Ouch. That's really ugly. And on 32bit ARM, we end-up spilling half of
the parameters on the stack, which is not going to help performance
either (not that this would be useful on 32bit ARM anyway...).

Any chance you could make this dependent on some compiler detection
mechanism?


With my arm compiler (gcc-4.4.4) the patch makes no difference -
unmap_and_move() isn't being inlined anyway.

How does this look?

Kevin, could you please retest?  I might have fat-fingered something...


Your patch on top of Geert's still compiles fine for me with gcc-4.7.3.
However, I'm not sure how specific we can be on the versions.

/me goes to test a few more compilers...   OK...

ICE: 4.7.1, 4.7.3, 4.8.3
OK: 4.6.3, 4.9.2, 4.9.3

The diff below[2] on top of yours compiles fine here and at least covers
the compilers I *know* to trigger the ICE.


I see ICE on 
arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.4-2ubuntu1) 4.7.4




Kevin


[1]
diff --git a/mm/migrate.c b/mm/migrate.c
index 25fd7f6291de..6e15ae3248e0 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -901,10 +901,10 @@ out:
}

/*
- * gcc-4.7.3 on arm gets an ICE when inlining unmap_and_move().  Work around
+ * gcc 4.7 and 4.8 on arm gets an ICE when inlining unmap_and_move().  Work 
around
 * it.
 */
-#if GCC_VERSION == 40703  defined(CONFIG_ARM)
+#if (GCC_VERSION = 40700  GCC_VERSION  40900)  defined(CONFIG_ARM)
#define ICE_noinline noinline
#else
#define ICE_noinline

___
linux-arm-kernel mailing list
linux-arm-ker...@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-01 Thread Marc Zyngier
On 01/04/15 10:37, Geert Uytterhoeven wrote:
   Hi Kevin,
 
 On Tue, 31 Mar 2015, Kevin Hilman wrote:
 Ard Biesheuvel ard.biesheu...@linaro.org writes:
 Nope, that branch is already part of linux-next, and linux-next still
 fails to compile for 20+ defconfigs[1]

 Could you elaborate on the issue please? What is the error you are
 getting, and can you confirm that is is caused by ld choking on the
 linker script? If not, this is another error than the one we have been
 trying to fix

 It's definitely not linker script related.

 Using arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.3-12ubuntu1) 4.7.3,
 here's the error when building for multi_v7_defconfig (full log
 available[2]):

 ../mm/migrate.c: In function 'migrate_pages':
 ../mm/migrate.c:1148:1: internal compiler error: in push_minipool_fix, at 
 config/arm/arm.c:13101
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See file:///usr/share/doc/gcc-4.7/README.Bugs for instructions.
 Preprocessed source stored into /tmp/ccO1Nz1m.out file, please attach
 this to your bugreport.
 make[2]: *** [mm/migrate.o] Error 1
 make[2]: Target `__build' not remade because of errors.
 make[1]: *** [mm] Error 2

 build bisect points to commit 21f992084aeb[3], but that doesn't revert
 cleanly so I haven't got any further than that yet.
 
 I installed gcc-arm-linux-gnueabi (4:4.7.2-1 from Ubuntu 14.04 LTS) and could
 reproduce the ICE. I came up with the workaround below.
 Does this work for you?
 
 From 7ebe83316eaf1952e55a76754ce7a5832e461b8c Mon Sep 17 00:00:00 2001
 From: Geert Uytterhoeven geert+rene...@glider.be
 Date: Wed, 1 Apr 2015 11:22:51 +0200
 Subject: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in
  gcc 4.7.3
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
 With gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) :
 
 mm/migrate.c: In function ‘migrate_pages’:
 mm/migrate.c:1148:1: internal compiler error: in push_minipool_fix, at 
 config/arm/arm.c:13500
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See file:///usr/share/doc/gcc-4.7/README.Bugs for instructions.
 Preprocessed source stored into /tmp/ccPoM1tr.out file, please attach 
 this to your bugreport.
 make[1]: *** [mm/migrate.o] Error 1
 make: *** [mm/migrate.o] Error 2
 
 Mark unmap_and_move() (which is used in a single place only) noinline
 to work around this compiler bug.
 
 Reported-by: Kevin Hilman khil...@kernel.org
 Signed-off-by: Geert Uytterhoeven geert+rene...@glider.be
 ---
  mm/migrate.c | 7 ---
  1 file changed, 4 insertions(+), 3 deletions(-)
 
 diff --git a/mm/migrate.c b/mm/migrate.c
 index 114602a68111d809..98f8574456c2010c 100644
 --- a/mm/migrate.c
 +++ b/mm/migrate.c
 @@ -904,9 +904,10 @@ out:
   * Obtain the lock on page, remove all ptes and migrate the page
   * to the newly allocated page in newpage.
   */
 -static int unmap_and_move(new_page_t get_new_page, free_page_t put_new_page,
 - unsigned long private, struct page *page, int force,
 - enum migrate_mode mode)
 +static noinline int unmap_and_move(new_page_t get_new_page,
 +free_page_t put_new_page,
 +unsigned long private, struct page *page,
 +int force, enum migrate_mode mode)
  {
   int rc = 0;
   int *result = NULL;
 

Ouch. That's really ugly. And on 32bit ARM, we end-up spilling half of
the parameters on the stack, which is not going to help performance
either (not that this would be useful on 32bit ARM anyway...).

Any chance you could make this dependent on some compiler detection
mechanism?

Thanks,

M.
-- 
Jazz is not dead. It just smells funny...
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-01 Thread Andrew Morton
On Wed, 01 Apr 2015 10:47:49 +0100 Marc Zyngier marc.zyng...@arm.com wrote:

  -static int unmap_and_move(new_page_t get_new_page, free_page_t 
  put_new_page,
  -   unsigned long private, struct page *page, int force,
  -   enum migrate_mode mode)
  +static noinline int unmap_and_move(new_page_t get_new_page,
  +  free_page_t put_new_page,
  +  unsigned long private, struct page *page,
  +  int force, enum migrate_mode mode)
   {
  int rc = 0;
  int *result = NULL;
  
 
 Ouch. That's really ugly. And on 32bit ARM, we end-up spilling half of
 the parameters on the stack, which is not going to help performance
 either (not that this would be useful on 32bit ARM anyway...).
 
 Any chance you could make this dependent on some compiler detection
 mechanism?

With my arm compiler (gcc-4.4.4) the patch makes no difference -
unmap_and_move() isn't being inlined anyway.

How does this look?

Kevin, could you please retest?  I might have fat-fingered something...

--- 
a/mm/migrate.c~mm-migrate-mark-unmap_and_move-noinline-to-avoid-ice-in-gcc-473-fix
+++ a/mm/migrate.c
@@ -901,10 +901,20 @@ out:
 }
 
 /*
+ * gcc-4.7.3 on arm gets an ICE when inlining unmap_and_move().  Work around
+ * it.
+ */
+#if GCC_VERSION == 40703  defined(CONFIG_ARM)
+#define ICE_noinline noinline
+#else
+#define ICE_noinline
+#endif
+
+/*
  * Obtain the lock on page, remove all ptes and migrate the page
  * to the newly allocated page in newpage.
  */
-static noinline int unmap_and_move(new_page_t get_new_page,
+static ICE_noinline int unmap_and_move(new_page_t get_new_page,
   free_page_t put_new_page,
   unsigned long private, struct page *page,
   int force, enum migrate_mode mode)
_

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-01 Thread Kevin Hilman
Geert Uytterhoeven ge...@linux-m68k.org writes:

[...]

 build bisect points to commit 21f992084aeb[3], but that doesn't revert
 cleanly so I haven't got any further than that yet.

 I installed gcc-arm-linux-gnueabi (4:4.7.2-1 from Ubuntu 14.04 LTS) and could
 reproduce the ICE. I came up with the workaround below.

Awesome, thanks!

 Does this work for you?

Yes, that patch works well and fixes the regression. Build results for
all the defconfigs here:

   http://kernelci.org/build/khilman/kernel/v4.0-rc6-8294-g2ef3958cc27e/

and the remaining issues arent' realted to this ICE.

 From 7ebe83316eaf1952e55a76754ce7a5832e461b8c Mon Sep 17 00:00:00 2001
 From: Geert Uytterhoeven geert+rene...@glider.be
 Date: Wed, 1 Apr 2015 11:22:51 +0200
 Subject: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in
  gcc 4.7.3
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit

 With gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) :

 mm/migrate.c: In function ‘migrate_pages’:
 mm/migrate.c:1148:1: internal compiler error: in push_minipool_fix, at 
 config/arm/arm.c:13500
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See file:///usr/share/doc/gcc-4.7/README.Bugs for instructions.
 Preprocessed source stored into /tmp/ccPoM1tr.out file, please attach 
 this to your bugreport.
 make[1]: *** [mm/migrate.o] Error 1
 make: *** [mm/migrate.o] Error 2

 Mark unmap_and_move() (which is used in a single place only) noinline
 to work around this compiler bug.

 Reported-by: Kevin Hilman khil...@kernel.org
 Signed-off-by: Geert Uytterhoeven geert+rene...@glider.be

Tested-by: Kevin Hilman khil...@linaro.org

 ---
  mm/migrate.c | 7 ---
  1 file changed, 4 insertions(+), 3 deletions(-)

 diff --git a/mm/migrate.c b/mm/migrate.c
 index 114602a68111d809..98f8574456c2010c 100644
 --- a/mm/migrate.c
 +++ b/mm/migrate.c
 @@ -904,9 +904,10 @@ out:
   * Obtain the lock on page, remove all ptes and migrate the page
   * to the newly allocated page in newpage.
   */
 -static int unmap_and_move(new_page_t get_new_page, free_page_t put_new_page,
 - unsigned long private, struct page *page, int force,
 - enum migrate_mode mode)
 +static noinline int unmap_and_move(new_page_t get_new_page,
 +free_page_t put_new_page,
 +unsigned long private, struct page *page,
 +int force, enum migrate_mode mode)
  {
   int rc = 0;
   int *result = NULL;
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-01 Thread Kevin Hilman
Andrew Morton a...@linux-foundation.org writes:

 On Wed, 01 Apr 2015 10:47:49 +0100 Marc Zyngier marc.zyng...@arm.com wrote:

  -static int unmap_and_move(new_page_t get_new_page, free_page_t 
  put_new_page,
  -  unsigned long private, struct page *page, int force,
  -  enum migrate_mode mode)
  +static noinline int unmap_and_move(new_page_t get_new_page,
  + free_page_t put_new_page,
  + unsigned long private, struct page *page,
  + int force, enum migrate_mode mode)
   {
 int rc = 0;
 int *result = NULL;
  
 
 Ouch. That's really ugly. And on 32bit ARM, we end-up spilling half of
 the parameters on the stack, which is not going to help performance
 either (not that this would be useful on 32bit ARM anyway...).
 
 Any chance you could make this dependent on some compiler detection
 mechanism?

 With my arm compiler (gcc-4.4.4) the patch makes no difference -
 unmap_and_move() isn't being inlined anyway.

 How does this look?

 Kevin, could you please retest?  I might have fat-fingered something...

Your patch on top of Geert's still compiles fine for me with gcc-4.7.3.
However, I'm not sure how specific we can be on the versions.  

/me goes to test a few more compilers...   OK...

ICE: 4.7.1, 4.7.3, 4.8.3
OK: 4.6.3, 4.9.2, 4.9.3

The diff below[2] on top of yours compiles fine here and at least covers
the compilers I *know* to trigger the ICE.

Kevin


[1]
diff --git a/mm/migrate.c b/mm/migrate.c
index 25fd7f6291de..6e15ae3248e0 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -901,10 +901,10 @@ out:
 }
 
 /*
- * gcc-4.7.3 on arm gets an ICE when inlining unmap_and_move().  Work around
+ * gcc 4.7 and 4.8 on arm gets an ICE when inlining unmap_and_move().  Work 
around
  * it.
  */
-#if GCC_VERSION == 40703  defined(CONFIG_ARM)
+#if (GCC_VERSION = 40700  GCC_VERSION  40900)  defined(CONFIG_ARM)
 #define ICE_noinline noinline
 #else
 #define ICE_noinline
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mm/migrate: Mark unmap_and_move() noinline to avoid ICE in gcc 4.7.3

2015-04-01 Thread Russell King - ARM Linux
On Wed, Apr 01, 2015 at 02:54:59PM -0700, Kevin Hilman wrote:
 Your patch on top of Geert's still compiles fine for me with gcc-4.7.3.
 However, I'm not sure how specific we can be on the versions.  
 
 /me goes to test a few more compilers...   OK...
 
 ICE: 4.7.1, 4.7.3, 4.8.3
 OK: 4.6.3, 4.9.2, 4.9.3
 
 The diff below[2] on top of yours compiles fine here and at least covers
 the compilers I *know* to trigger the ICE.

Interesting.  I'm using stock gcc 4.7.4 here, though I'm not building
-next (only mainline + my tree + arm-soc) and it hasn't shown a problem
yet.

I think we need to ask the question: is the bug in stock GCC or Linaro
GCC?  If it's not in stock GCC, then it's a GCC vendor problem :)

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html