From 264183944009390698f02b0a48492bd135a91526 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Fri, 28 Feb 2020 12:43:54 -0800 Subject: [PATCH] mm: vmpressure: Don't exclude any allocation types Although userspace processes can't directly help with kernel memory pressure, killing userspace processes can relieve kernel memory if they are responsible for that pressure in the first place. It doesn't make sense to exclude any allocation types knowing that userspace can indeed affect all memory pressure, so don't exclude any allocation types from the pressure calculations. Signed-off-by: Sultan Alsawaf Signed-off-by: Ruchit --- mm/vmpressure.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 63f5bc2a9365..79207bd5f729 100755 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c @@ -278,20 +278,6 @@ static void vmpressure_memcg(gfp_t gfp, struct mem_cgroup *memcg, bool tree, { struct vmpressure *vmpr = memcg_to_vmpressure(memcg); - /* - * Here we only want to account pressure that userland is able to - * help us with. For example, suppose that DMA zone is under - * pressure; if we notify userland about that kind of pressure, - * then it will be mostly a waste as it will trigger unnecessary - * freeing of memory by userland (since userland is more likely to - * have HIGHMEM/MOVABLE pages instead of the DMA fallback). That - * is why we include only movable, highmem and FS/IO pages. - * Indirect reclaim (kswapd) sets sc->gfp_mask to GFP_KERNEL, so - * we account it too. - */ - if (!(gfp & (__GFP_HIGHMEM | __GFP_MOVABLE | __GFP_IO | __GFP_FS))) - return; - /* * If we got here with no pages scanned, then that is an indicator * that reclaimer was unable to find any shrinkable LRUs at the @@ -383,9 +369,6 @@ static void vmpressure_global(gfp_t gfp, unsigned long scanned, unsigned long pressure; unsigned long stall; - if (!(gfp & (__GFP_HIGHMEM | __GFP_MOVABLE | __GFP_IO | __GFP_FS))) - return; - if (!scanned) return;