summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/page_alloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 580a5f075ed0..708c0382c931 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2467,6 +2467,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
bool sync_migration = false;
bool deferred_compaction = false;
bool contended_compaction = false;
+ int retry = 5*HZ;
/*
* In the slowpath, we sanity check order to avoid ever trying to
@@ -2619,6 +2620,9 @@ rebalance:
goto nopage;
}
+ if (!--retry)
+ goto nopage;
+
goto restart;
}
}