Thread (63 messages) 63 messages, 5 authors, 2015-11-12

Re: [PATCH 8/8] mm: memcontrol: hook up vmpressure to socket pressure

From: Vladimir Davydov <hidden>
Date: 2015-10-22 18:58:10
Also in: cgroups, linux-mm, lkml

On Thu, Oct 22, 2015 at 12:21:36AM -0400, Johannes Weiner wrote:
...
quoted hunk ↗ jump to hunk
@@ -185,8 +183,29 @@ static void vmpressure_work_fn(struct work_struct *work)
 	vmpr->reclaimed = 0;
 	spin_unlock(&vmpr->sr_lock);
 
+	level = vmpressure_calc_level(scanned, reclaimed);
+
+	if (level > VMPRESSURE_LOW) {
So we start socket_pressure at MEDIUM. Why not at LOW or CRITICAL?
+		struct mem_cgroup *memcg;
+		/*
+		 * Let the socket buffer allocator know that we are
+		 * having trouble reclaiming LRU pages.
+		 *
+		 * For hysteresis, keep the pressure state asserted
+		 * for a second in which subsequent pressure events
+		 * can occur.
+		 *
+		 * XXX: is vmpressure a global feature or part of
+		 * memcg? There shouldn't be anything memcg-specific
+		 * about exporting reclaim success ratios from the VM.
+		 */
+		memcg = container_of(vmpr, struct mem_cgroup, vmpressure);
+		if (memcg != root_mem_cgroup)
+			memcg->socket_pressure = jiffies + HZ;
Why 1 second?

Thanks,
Vladimir
+	}
+
 	do {
-		if (vmpressure_event(vmpr, scanned, reclaimed))
+		if (vmpressure_event(vmpr, level))
 			break;
 		/*
 		 * If not handled, propagate the event upward into the
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help