Linux cgroups development
 help / color / mirror / Atom feed
From: xiexiangyou <xiexiangyou-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: zhouxiangjiu-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	luonengjun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
Subject: A issue when migrating a process's memory using cgroup
Date: Thu, 10 Apr 2014 15:34:08 +0800	[thread overview]
Message-ID: <53464970.8060404@huawei.com> (raw)

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.


Regards,
-xie

             reply	other threads:[~2014-04-10  7:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10  7:34 xiexiangyou [this message]
     [not found] ` <53464970.8060404-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-04-10  8:04   ` A issue when migrating a process's memory using cgroup Li Zefan
     [not found]     ` <534650AB.4070709-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-04-10  8:28       ` Li Zefan

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=53464970.8060404@huawei.com \
    --to=xiexiangyou-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=luonengjun-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