linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/vmpressure.c: Include GFP_KERNEL flag to vmpressure
@ 2020-03-09 11:31 Shaju Abraham
  2020-03-09 11:58 ` Michal Hocko
  0 siblings, 1 reply; 5+ messages in thread
From: Shaju Abraham @ 2020-03-09 11:31 UTC (permalink / raw)
  Cc: akpm, linux-mm, linux-kernel, shajunutanix, Shaju Abraham

The VM pressure notification flags have excluded GFP_KERNEL with the
reasoning that user land will not be able to take any action in case of
kernel memory being low. This is not true always. Consider the case of
a user land program managing all the huge memory pages. By including
GFP_KERNEL flag whenever the kernel memory is low, pressure notification
can be send, and the manager process can split huge pages to satisfy kernel
memory requirement.
This is a common scanario in cloud. Most of the host memory is reserved
as hugepages and can be broken down to small pages on demand. This is
done to minimise fragmentation so that Virtual Machine power on will be
successful always.

Signed-off-by: Shaju Abraham <shaju.abraham@nutanix.com>
---
 mm/vmpressure.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/vmpressure.c b/mm/vmpressure.c
index 4bac22fe1aa2..7ccfb3dd8173 100644
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -253,7 +253,8 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
 	 * 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)))
+	if (!(gfp & (__GFP_HIGHMEM | __GFP_MOVABLE | __GFP_IO |
+		     __GFP_FS | GFP_KERNEL)))
 		return;
 
 	/*
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-10  7:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 11:31 [PATCH] mm/vmpressure.c: Include GFP_KERNEL flag to vmpressure Shaju Abraham
2020-03-09 11:58 ` Michal Hocko
2020-03-09 15:32   ` Shaju Abraham
2020-03-09 16:12     ` Michal Hocko
2020-03-10  7:39       ` Shaju Abraham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).