mm: vmpressure: Ignore costly-order allocations for direct reclaim too

The direct reclaim vmpressure path was erroneously excluded from the
PAGE_ALLOC_COSTLY_ORDER check which was added in commit "mm: vmpressure:
Ignore allocation orders above PAGE_ALLOC_COSTLY_ORDER".

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
fourteen
Sultan Alsawaf 4 years ago committed by Jenna
parent db5c9632ef
commit b40c4e120b
  1. 3
      include/linux/vmpressure.h
  2. 5
      mm/vmpressure.c
  3. 2
      mm/vmscan.c

@ -36,7 +36,8 @@ extern int vmpressure_notifier_unregister(struct notifier_block *nb);
extern void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
unsigned long scanned, unsigned long reclaimed,
int order);
extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio);
extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio,
int order);
#ifdef CONFIG_MEMCG
extern void vmpressure_init(struct vmpressure *vmpr);

@ -437,8 +437,11 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
*
* This function does not return any value.
*/
void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio)
void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio, int order)
{
if (order > PAGE_ALLOC_COSTLY_ORDER)
return;
/*
* We only use prio for accounting critical level. For more info
* see comment for vmpressure_level_critical_prio variable above.

@ -3141,7 +3141,7 @@ retry:
do {
vmpressure_prio(sc->gfp_mask, sc->target_mem_cgroup,
sc->priority);
sc->priority, sc->order);
sc->nr_scanned = 0;
shrink_zones(zonelist, sc);

Loading…
Cancel
Save