Re: [0/2] memrlimit improve error handling

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Balbir Singh
Date: Tuesday, June 24, 2008 - 6:01 pm

Hugh Dickins wrote:

Thanks for the review and feedback, I'll take a look and fix


Fair enough, will fix


I did look at that and use that code, but we initialize ret = -EINVAL and then
we have the checks for

        if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE))
                goto out;

        if (addr & ~PAGE_MASK)
                goto out;

In out, we check for
	ret & ~PAGE_MASK

That's OK for vm_unacct_memory, since charged is set to 0, but not for
mem_cgroup_uncharge_as as we uncharge (new_len - old_len) >> PAGE_SHIFT);

I'll find a way to see if we can convert both over.


Yes, that needs fixing


Yes, we need to prevent charging and migration race.


Yes, it can be moved there


Will do



I've never tried that before


Sure, will do


Yes, that is nasty and a bad miss. It should be easy to fix, but will require
extensive testing.



You seem to have read my mind, my motivation for memrlimits is

1. Administrators to set a limit and be sure that a cgroup cannot consume more
swap + RSS than the assigned virtual memory limit
2. It allows applications to fail gracefully or decide what parts to free up
to get more memory or change their allocation pattern (a scientific application
deciding what size of matrix to allocate for example).

Excellent feedback, thanks for the review!

-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[0/2] memrlimit improve error handling, Balbir Singh, (Fri Jun 20, 8:01 am)
[2/2] memrlimit fix usage of tmp as a parameter name, Balbir Singh, (Fri Jun 20, 8:01 am)
Re: [0/2] memrlimit improve error handling, Hugh Dickins, (Tue Jun 24, 4:11 pm)
Re: [0/2] memrlimit improve error handling, Balbir Singh, (Tue Jun 24, 6:01 pm)
Re: [2/2] memrlimit fix usage of tmp as a parameter name, Andrew Morton, (Wed Jun 25, 4:41 pm)