File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -7004,7 +7004,7 @@ static inline bool has_unaccepted_memory(void)
7004
7004
7005
7005
static bool cond_accept_memory (struct zone * zone , unsigned int order )
7006
7006
{
7007
- long to_accept ;
7007
+ long to_accept , wmark ;
7008
7008
bool ret = false;
7009
7009
7010
7010
if (!has_unaccepted_memory ())
@@ -7013,8 +7013,18 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order)
7013
7013
if (list_empty (& zone -> unaccepted_pages ))
7014
7014
return false;
7015
7015
7016
+ wmark = promo_wmark_pages (zone );
7017
+
7018
+ /*
7019
+ * Watermarks have not been initialized yet.
7020
+ *
7021
+ * Accepting one MAX_ORDER page to ensure progress.
7022
+ */
7023
+ if (!wmark )
7024
+ return try_to_accept_memory_one (zone );
7025
+
7016
7026
/* How much to accept to get to promo watermark? */
7017
- to_accept = promo_wmark_pages ( zone ) -
7027
+ to_accept = wmark -
7018
7028
(zone_page_state (zone , NR_FREE_PAGES ) -
7019
7029
__zone_watermark_unusable_free (zone , order , 0 ) -
7020
7030
zone_page_state (zone , NR_UNACCEPTED ));
You can’t perform that action at this time.
0 commit comments