Re: cgroup.procs versus tasks (cgroups)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Thanks  a lot Vlad. This explains it.
- Does anybody know of a ps command (or a filter to  ps command)
which will display only multithreaded
processes (list processes by TGID) ?  (I know now about the option of
displaying cgroup.procs , but is something parallel can be done with ps ? )

rgs,
Kevin


On Tue, Apr 2, 2013 at 10:40 AM, Vlad Dogaru <ddvlad@xxxxxxxxxxxxxxxx> wrote:
> On Tue, Apr 02, 2013 at 05:54:56AM +0300, Kevin Wilson wrote:
>> Hi?
>> Any idea what is the difference  "cgroup.procs" entry and "tasks"
>> entry of cgroup sysfs?
>> both represent pid lists.
>> I ran:
>> cat /sys/fs/cgroup/cpuset/cgroup.procs
>> and
>> cat  /sys/fs/cgroup/cpuset/tasks
>> and entries of cgroup.procs appear in tasks.
>>
>> However there are many more tasks than cgroup.procs:
>>
>> cat  /sys/fs/cgroup/cpuset/cgroup.procs | wc -l
>> 153
>> cat  /sys/fs/cgroup/cpuset/tasks | wc -l
>> 383
>
> The difference you are seeing is because there are some multithreaded
> processes in your cpuset.  In the cgroup.procs file, each such process
> apears only once (listed by its TGID).  In the tasks file, each thread
> appears once (listed by its PID).
>
> Check the pidlist_array_load function in kernel/cgroup.c.  procs is a
> list of (unique) TGIDs, while tasks is a list of PIDs.
>
> Hope this helps,
> Vlad

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux