Linux cgroups development
 help / color / mirror / Atom feed
From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: xiexiangyou <xiexiangyou-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	zhouxiangjiu-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	luonengjun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
Subject: Re: A issue when migrating a process's memory using cgroup
Date: Thu, 10 Apr 2014 16:28:25 +0800	[thread overview]
Message-ID: <53465629.2060202@huawei.com> (raw)
In-Reply-To: <534650AB.4070709-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

On 2014/4/10 16:04, Li Zefan wrote:
> On 2014/4/10 15:34, xiexiangyou wrote:
>> Hi all,
>>
>> I met a problem when I migrate a process's memory using cgroup.
>> Two processes, process A and Process B. Process A has 20G memory, I migrate it from node0 to node1, by writing "1" to "cpuset.mems".
>> It will consume 20s time. At the time, I write process B's "cpuset.cpus" to bind the cpus. But setting "cpuset.cpus" is block untill
>> the first operation is finished.
>>
>>
>> So I read the cpuset code in kernel. In the function of "cpuset_write_resmask", Common handling for a write to a "cpus" or "mems" file,
>> It grabs the "cgroup_mutex" first, and release it until finish writing "cpus" or "mems". But if migrate large size memory
>> of a process using cpuset, it will consume much time. At the time, other handling for write to "cpuset.cpus" and "cpuset.mems"
>> will blocked because of "cgroup_mutex".
>>
>> In this case, I think the "cgroup_mutex" in "cpuset_write_resmask" should be replace by littler granularity lock.
>>
> 
> Yeah, in newer kernels we no longer grab cgroup_mutex in cpuset_write_resmask().
> 

But it will still block, because cpuset_mutex is still a global lock,
not a per cpuset lock.

      parent reply	other threads:[~2014-04-10  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10  7:34 A issue when migrating a process's memory using cgroup xiexiangyou
     [not found] ` <53464970.8060404-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-04-10  8:04   ` Li Zefan
     [not found]     ` <534650AB.4070709-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-04-10  8:28       ` Li Zefan [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=53465629.2060202@huawei.com \
    --to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=luonengjun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=xiexiangyou-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=zhouxiangjiu-hv44wF8Li93QT0dZR+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