From: Balbir Singh <balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: KAMEZAWA Hiroyuki
<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Cc: "containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org"
<containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>,
"linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"
<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
"menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org"
<menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Subject: Re: Question : memrlimit cgroup's task_move (2.6.26-rc5-mm3)
Date: Fri, 20 Jun 2008 19:03:55 +0530 [thread overview]
Message-ID: <485BB1C3.6000009@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080620091316.80771d14.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
KAMEZAWA Hiroyuki wrote:
> On Thu, 19 Jun 2008 23:55:56 +0530
> Balbir Singh <balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> wrote:
>
>> * KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org> [2008-06-19 12:14:35]:
>>
>>> I used memrlimit cgroup at the first time.
>>>
>>> May I ask a question about memrlimit cgroup ?
>>>
>> Hi, Kamezawa-San,
>>
>> Could you please review/test the patch below to see if it solves your
>> problem? If it does, I'll push it up to Andrew
>>
>
> At quick glance,
>> + /*
>> + * NOTE: Even though we do the necessary checks in can_attach(),
>> + * by the time we come here, there is a chance that we still
>> + * fail (the memrlimit cgroup has grown its usage, and the
>> + * addition of total_vm will no longer fit into its limit)
>> + */
> I don't like this kind of holes. Considering tests which are usually done
> by developpers, the problem seems not to be mentioned as "rare"..
> It seems we can easily cause Warning. right ?
>
> Even if you don't want to handle this case now, please mention as "TBD"
> rather than as "NOTE".
>
Honestly to fix this problem completely, we need transactional management in
cgroups. Both can_attach() and attach() are called with cgroup_mutex held, but
total_vm is changed with mmap_sem held.
What we can do is
1. Implement a routine attach_failed() in cgroups, that is called for each task
for which can_attach() succeeded, if any of the can_attach() routine returns
an error
2. Do the migration in can_attach() and unroll in attach_failed()
--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
prev parent reply other threads:[~2008-06-20 13:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-19 3:14 Question : memrlimit cgroup's task_move (2.6.26-rc5-mm3) KAMEZAWA Hiroyuki
[not found] ` <20080619121435.f868c110.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-06-19 3:13 ` Balbir Singh
[not found] ` <4859CEE7.9030505-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-06-19 3:24 ` KAMEZAWA Hiroyuki
[not found] ` <20080619122429.138a1d32.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-06-19 10:22 ` KAMEZAWA Hiroyuki
[not found] ` <485A5160.5070901-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-06-19 13:38 ` kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A
[not found] ` <20080619192227.972ded64.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-06-19 12:30 ` Balbir Singh
2008-06-19 16:41 ` Balbir Singh
2008-06-19 18:25 ` Balbir Singh
[not found] ` <20080619182556.GA10461-SINUvgVNF2CyUtPGxGje5AC/G2K4zDHf@public.gmane.org>
2008-06-20 0:13 ` KAMEZAWA Hiroyuki
[not found] ` <20080620091316.80771d14.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-06-20 13:33 ` Balbir Singh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=485BB1C3.6000009@linux.vnet.ibm.com \
--to=balbir-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox