Thread (10 messages) 10 messages, 3 authors, 2017-02-23

Re: [PATCH 2/2] mm/cgroup: delay soft limit data allocation

From: Laurent Dufour <hidden>
Date: 2017-02-23 10:41:21
Also in: linux-mm, lkml

On 23/02/2017 02:16, Balbir Singh wrote:
On Wed, Feb 22, 2017 at 04:58:11PM +0100, Laurent Dufour wrote:
quoted
Until a soft limit is set to a cgroup, the soft limit data are useless
so delay this allocation when a limit is set.

Suggested-by: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Laurent Dufour <redacted>
---
<snip>
quoted
@@ -3000,6 +3035,8 @@ static ssize_t mem_cgroup_write(struct kernfs_open_file *of,
 		}
 		break;
 	case RES_SOFT_LIMIT:
+		if (!soft_limit_initialized)
+			soft_limit_initialize();
What happens if this fails? Do we disable this interface?
It's a good idea, but I wonder if we can deal with certain
memory cgroups not supporting soft limits due to memory
shortage at the time of using them.
Thanks Balbir for the review.

Regarding this point, Michal sent a new proposal which will return
-ENOMEM in the case the initialization failed. I'll send a new series in
that way.
quoted
 		memcg->soft_limit = nr_pages;
 		ret = 0;
 		break;
Balbir Singh.
--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help