Skip to content

Commit

Permalink
mm/migrate: mark unmap_and_move() "noinline" to avoid ICE in gcc 4.7.3
Browse files Browse the repository at this point in the history
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.

[[email protected]: make it conditional on gcc-4.7.3 and arm]
[[email protected]: fine-tune compiler versions]
[[email protected]: fix comment]
Signed-off-by: Geert Uytterhoeven <[email protected]>
Reported-by: Kevin Hilman <[email protected]>
Cc: Marc Zyngier <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Tested-by: Lina Iyer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
geertu authored and torvalds committed Apr 14, 2015
1 parent 692297d commit ef2a515
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,13 +900,24 @@ static int __unmap_and_move(struct page *page, struct page *newpage,
return rc;
}

/*
* gcc 4.7 and 4.8 on arm get an ICEs when inlining unmap_and_move(). Work
* around it.
*/
#if (GCC_VERSION >= 40700 && GCC_VERSION < 40900) && 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 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 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)
{
int rc = 0;
int *result = NULL;
Expand Down

0 comments on commit ef2a515

Please sign in to comment.