|
@@ -1837,8 +1837,15 @@ static int __mem_cgroup_do_charge(struct mem_cgroup *mem, gfp_t gfp_mask,
|
|
|
flags |= MEM_CGROUP_RECLAIM_NOSWAP;
|
|
|
} else
|
|
|
mem_over_limit = mem_cgroup_from_res_counter(fail_res, res);
|
|
|
-
|
|
|
- if (csize > PAGE_SIZE) /* change csize and retry */
|
|
|
+ /*
|
|
|
+ * csize can be either a huge page (HPAGE_SIZE), a batch of
|
|
|
+ * regular pages (CHARGE_SIZE), or a single regular page
|
|
|
+ * (PAGE_SIZE).
|
|
|
+ *
|
|
|
+ * Never reclaim on behalf of optional batching, retry with a
|
|
|
+ * single page instead.
|
|
|
+ */
|
|
|
+ if (csize == CHARGE_SIZE)
|
|
|
return CHARGE_RETRY;
|
|
|
|
|
|
if (!(gfp_mask & __GFP_WAIT))
|