linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch] mm, vmpressure: add high level
@ 2013-10-17  0:43 David Rientjes
  2013-10-17  3:05 ` Anton Vorontsov
  2013-10-17  3:51 ` [bug] get_maintainer.pl incomplete output David Rientjes
  0 siblings, 2 replies; 14+ messages in thread
From: David Rientjes @ 2013-10-17  0:43 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Anton Vorontsov, Michal Hocko, Kirill A. Shutemov, linux-kernel,
	linux-mm

Vmpressure has two important levels: medium and critical.  Medium is 
defined at 60% and critical is defined at 95%.

We have a customer who needs a notification at a higher level than medium, 
which is slight to moderate reclaim activity, and before critical to start 
throttling incoming requests to save memory and avoid oom.

This patch adds the missing link: a high level defined at 80%.

In the future, it would probably be better to allow the user to specify an 
integer ratio for the notification rather than relying on arbitrarily 
specified levels.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/vmpressure.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mm/vmpressure.c b/mm/vmpressure.c
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -46,6 +46,7 @@ static const unsigned long vmpressure_win = SWAP_CLUSTER_MAX * 16;
  * unsuccessful reclaims there were.
  */
 static const unsigned int vmpressure_level_med = 60;
+static const unsigned int vmpressure_level_high = 80;
 static const unsigned int vmpressure_level_critical = 95;
 
 /*
@@ -88,6 +89,7 @@ static struct vmpressure *vmpressure_parent(struct vmpressure *vmpr)
 enum vmpressure_levels {
 	VMPRESSURE_LOW = 0,
 	VMPRESSURE_MEDIUM,
+	VMPRESSURE_HIGH,
 	VMPRESSURE_CRITICAL,
 	VMPRESSURE_NUM_LEVELS,
 };
@@ -95,6 +97,7 @@ enum vmpressure_levels {
 static const char * const vmpressure_str_levels[] = {
 	[VMPRESSURE_LOW] = "low",
 	[VMPRESSURE_MEDIUM] = "medium",
+	[VMPRESSURE_HIGH] = "high",
 	[VMPRESSURE_CRITICAL] = "critical",
 };
 
@@ -102,6 +105,8 @@ static enum vmpressure_levels vmpressure_level(unsigned long pressure)
 {
 	if (pressure >= vmpressure_level_critical)
 		return VMPRESSURE_CRITICAL;
+	else if (pressure >= vmpressure_level_high)
+		return VMPRESSURE_HIGH;
 	else if (pressure >= vmpressure_level_med)
 		return VMPRESSURE_MEDIUM;
 	return VMPRESSURE_LOW;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2013-11-15  2:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-17  0:43 [patch] mm, vmpressure: add high level David Rientjes
2013-10-17  3:05 ` Anton Vorontsov
2013-10-17  3:44   ` David Rientjes
2013-10-17  3:51 ` [bug] get_maintainer.pl incomplete output David Rientjes
2013-10-17  4:03   ` Joe Perches
2013-10-17  4:19     ` David Rientjes
2013-10-17  4:36       ` Joe Perches
2013-10-17 19:12   ` Andrew Morton
2013-10-17 19:23     ` Joe Perches
2013-10-18  4:17     ` Joe Perches
2013-10-18 22:58       ` David Rientjes
2013-10-19  0:25         ` Joe Perches
2013-11-14 21:56       ` [PATCH] get_maintainer: Add commit author information to --rolestats Joe Perches
2013-11-15  2:16         ` Chen Gang

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).