public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP]  [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue
@ 2016-07-08  6:49 shuang.qiu
  2016-07-11 13:12 ` Jan Stancek
  0 siblings, 1 reply; 5+ messages in thread
From: shuang.qiu @ 2016-07-08  6:49 UTC (permalink / raw)
  To: ltp

From: Shuang Qiu <shuang.qiu@oracle.com>

Sometimes there is no cpuset. prefix for cpuset subsystem.
Try either $mount_point/XXXX or $mount_point/cpuset.XXXX.

Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
---
 .../controllers/cgroup_fj/cgroup_fj_common.sh      |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
index df2cbfc..13e2938 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
@@ -69,8 +69,13 @@ create_subgroup()
     # cpuset.cpus and cpuset.mems must be initialized with suitable value
     # before any pids are attached
     if [ "$subsystem" == "cpuset" ]; then
-        ROD cat "$mount_point/cpuset.cpus" \> "$path/cpuset.cpus"
-        ROD cat "$mount_point/cpuset.mems" \> "$path/cpuset.mems"
+        if [ -e "$mount_point/cpus" ]; then
+            ROD cat "$mount_point/cpus" \> "$path/cpus"
+            ROD cat "$mount_point/mems" \> "$path/mems"
+        else
+            ROD cat "$mount_point/cpuset.cpus" \> "$path/cpuset.cpus"
+            ROD cat "$mount_point/cpuset.mems" \> "$path/cpuset.mems"
+        fi
     fi
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue
  2016-07-08  6:49 [LTP] [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue shuang.qiu
@ 2016-07-11 13:12 ` Jan Stancek
  2016-07-12 15:42   ` Shuang Qiu
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Stancek @ 2016-07-11 13:12 UTC (permalink / raw)
  To: ltp





----- Original Message -----
> From: "shuang qiu" <shuang.qiu@oracle.com>
> To: ltp@lists.linux.it
> Sent: Friday, 8 July, 2016 8:49:02 AM
> Subject: [LTP]  [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue
> 
> From: Shuang Qiu <shuang.qiu@oracle.com>
> 
> Sometimes there is no cpuset. prefix for cpuset subsystem.
> Try either $mount_point/XXXX or $mount_point/cpuset.XXXX.

This appears to be due to legacy of:
  commit 8793d854edbc2774943a4b0de3304dc73991159a
  Author: Paul Menage <menage@google.com>
  Date:   Thu Oct 18 23:39:39 2007 -0700
    Task Control Groups: make cpusets a client of cgroups

so it depends on how you mount it:

# mount -t cpuset cpuset /mnt/test
# ls -la /mnt/test
total 0
drwxr-xr-x. 2 root root  0 Jul 11 15:01 .
drwxr-xr-x. 6 root root 63 Jul 11 14:58 ..
-rw-r--r--. 1 root root  0 Jul 11 15:01 cgroup.clone_children
--w--w--w-. 1 root root  0 Jul 11 15:01 cgroup.event_control
-rw-r--r--. 1 root root  0 Jul 11 15:01 cgroup.procs
-r--r--r--. 1 root root  0 Jul 11 15:01 cgroup.sane_behavior
-rw-r--r--. 1 root root  0 Jul 11 15:01 cpu_exclusive
-rw-r--r--. 1 root root  0 Jul 11 15:01 cpus
-rw-r--r--. 1 root root  0 Jul 11 15:01 mem_exclusive
-rw-r--r--. 1 root root  0 Jul 11 15:01 mem_hardwall
-rw-r--r--. 1 root root  0 Jul 11 15:01 memory_migrate
-r--r--r--. 1 root root  0 Jul 11 15:01 memory_pressure
-rw-r--r--. 1 root root  0 Jul 11 15:01 memory_pressure_enabled
-rw-r--r--. 1 root root  0 Jul 11 15:01 memory_spread_page
-rw-r--r--. 1 root root  0 Jul 11 15:01 memory_spread_slab
-rw-r--r--. 1 root root  0 Jul 11 15:01 mems
-rw-r--r--. 1 root root  0 Jul 11 15:01 notify_on_release
-rw-r--r--. 1 root root  0 Jul 11 15:01 release_agent
-rw-r--r--. 1 root root  0 Jul 11 15:01 sched_load_balance
-rw-r--r--. 1 root root  0 Jul 11 15:01 sched_relax_domain_level
-rw-r--r--. 1 root root  0 Jul 11 15:01 tasks

# mount -t cgroup -o cpuset cpuset /mnt/test
# ls -la /mnt/test
total 0
drwxr-xr-x. 2 root root  0 Jul 11 15:02 .
drwxr-xr-x. 6 root root 63 Jul 11 14:58 ..
-rw-r--r--. 1 root root  0 Jul 11 15:02 cgroup.clone_children
--w--w--w-. 1 root root  0 Jul 11 15:02 cgroup.event_control
-rw-r--r--. 1 root root  0 Jul 11 15:02 cgroup.procs
-r--r--r--. 1 root root  0 Jul 11 15:02 cgroup.sane_behavior
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.cpu_exclusive
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.cpus
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.mem_exclusive
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.mem_hardwall
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_migrate
-r--r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_pressure
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_pressure_enabled
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_spread_page
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_spread_slab
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.mems
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.sched_load_balance
-rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.sched_relax_domain_level
-rw-r--r--. 1 root root  0 Jul 11 15:02 notify_on_release
-rw-r--r--. 1 root root  0 Jul 11 15:02 release_agent
-rw-r--r--. 1 root root  0 Jul 11 15:02 tasks

Patch looks OK to me, description could be more verbose.

Regards,
Jan

> 
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
> ---
>  .../controllers/cgroup_fj/cgroup_fj_common.sh      |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> index df2cbfc..13e2938 100755
> --- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> +++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
> @@ -69,8 +69,13 @@ create_subgroup()
>      # cpuset.cpus and cpuset.mems must be initialized with suitable value
>      # before any pids are attached
>      if [ "$subsystem" == "cpuset" ]; then
> -        ROD cat "$mount_point/cpuset.cpus" \> "$path/cpuset.cpus"
> -        ROD cat "$mount_point/cpuset.mems" \> "$path/cpuset.mems"
> +        if [ -e "$mount_point/cpus" ]; then
> +            ROD cat "$mount_point/cpus" \> "$path/cpus"
> +            ROD cat "$mount_point/mems" \> "$path/mems"
> +        else
> +            ROD cat "$mount_point/cpuset.cpus" \> "$path/cpuset.cpus"
> +            ROD cat "$mount_point/cpuset.mems" \> "$path/cpuset.mems"
> +        fi
>      fi
>  }
>  
> --
> 1.7.9.5
> 
> 
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue
  2016-07-11 13:12 ` Jan Stancek
@ 2016-07-12 15:42   ` Shuang Qiu
  0 siblings, 0 replies; 5+ messages in thread
From: Shuang Qiu @ 2016-07-12 15:42 UTC (permalink / raw)
  To: ltp

Thanks for explain this,Jan.
Will update the description.

Thanks
Shuang
On 07/11/2016 09:12 PM, Jan Stancek wrote:
>
>
>
> ----- Original Message -----
>> From: "shuang qiu" <shuang.qiu@oracle.com>
>> To: ltp@lists.linux.it
>> Sent: Friday, 8 July, 2016 8:49:02 AM
>> Subject: [LTP]  [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue
>>
>> From: Shuang Qiu <shuang.qiu@oracle.com>
>>
>> Sometimes there is no cpuset. prefix for cpuset subsystem.
>> Try either $mount_point/XXXX or $mount_point/cpuset.XXXX.
> This appears to be due to legacy of:
>    commit 8793d854edbc2774943a4b0de3304dc73991159a
>    Author: Paul Menage <menage@google.com>
>    Date:   Thu Oct 18 23:39:39 2007 -0700
>      Task Control Groups: make cpusets a client of cgroups
>
> so it depends on how you mount it:
>
> # mount -t cpuset cpuset /mnt/test
> # ls -la /mnt/test
> total 0
> drwxr-xr-x. 2 root root  0 Jul 11 15:01 .
> drwxr-xr-x. 6 root root 63 Jul 11 14:58 ..
> -rw-r--r--. 1 root root  0 Jul 11 15:01 cgroup.clone_children
> --w--w--w-. 1 root root  0 Jul 11 15:01 cgroup.event_control
> -rw-r--r--. 1 root root  0 Jul 11 15:01 cgroup.procs
> -r--r--r--. 1 root root  0 Jul 11 15:01 cgroup.sane_behavior
> -rw-r--r--. 1 root root  0 Jul 11 15:01 cpu_exclusive
> -rw-r--r--. 1 root root  0 Jul 11 15:01 cpus
> -rw-r--r--. 1 root root  0 Jul 11 15:01 mem_exclusive
> -rw-r--r--. 1 root root  0 Jul 11 15:01 mem_hardwall
> -rw-r--r--. 1 root root  0 Jul 11 15:01 memory_migrate
> -r--r--r--. 1 root root  0 Jul 11 15:01 memory_pressure
> -rw-r--r--. 1 root root  0 Jul 11 15:01 memory_pressure_enabled
> -rw-r--r--. 1 root root  0 Jul 11 15:01 memory_spread_page
> -rw-r--r--. 1 root root  0 Jul 11 15:01 memory_spread_slab
> -rw-r--r--. 1 root root  0 Jul 11 15:01 mems
> -rw-r--r--. 1 root root  0 Jul 11 15:01 notify_on_release
> -rw-r--r--. 1 root root  0 Jul 11 15:01 release_agent
> -rw-r--r--. 1 root root  0 Jul 11 15:01 sched_load_balance
> -rw-r--r--. 1 root root  0 Jul 11 15:01 sched_relax_domain_level
> -rw-r--r--. 1 root root  0 Jul 11 15:01 tasks
>
> # mount -t cgroup -o cpuset cpuset /mnt/test
> # ls -la /mnt/test
> total 0
> drwxr-xr-x. 2 root root  0 Jul 11 15:02 .
> drwxr-xr-x. 6 root root 63 Jul 11 14:58 ..
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cgroup.clone_children
> --w--w--w-. 1 root root  0 Jul 11 15:02 cgroup.event_control
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cgroup.procs
> -r--r--r--. 1 root root  0 Jul 11 15:02 cgroup.sane_behavior
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.cpu_exclusive
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.cpus
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.mem_exclusive
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.mem_hardwall
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_migrate
> -r--r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_pressure
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_pressure_enabled
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_spread_page
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.memory_spread_slab
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.mems
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.sched_load_balance
> -rw-r--r--. 1 root root  0 Jul 11 15:02 cpuset.sched_relax_domain_level
> -rw-r--r--. 1 root root  0 Jul 11 15:02 notify_on_release
> -rw-r--r--. 1 root root  0 Jul 11 15:02 release_agent
> -rw-r--r--. 1 root root  0 Jul 11 15:02 tasks
>
> Patch looks OK to me, description could be more verbose.
>
> Regards,
> Jan
>
>> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
>> ---
>>   .../controllers/cgroup_fj/cgroup_fj_common.sh      |    9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
>> b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
>> index df2cbfc..13e2938 100755
>> --- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
>> +++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
>> @@ -69,8 +69,13 @@ create_subgroup()
>>       # cpuset.cpus and cpuset.mems must be initialized with suitable value
>>       # before any pids are attached
>>       if [ "$subsystem" == "cpuset" ]; then
>> -        ROD cat "$mount_point/cpuset.cpus" \> "$path/cpuset.cpus"
>> -        ROD cat "$mount_point/cpuset.mems" \> "$path/cpuset.mems"
>> +        if [ -e "$mount_point/cpus" ]; then
>> +            ROD cat "$mount_point/cpus" \> "$path/cpus"
>> +            ROD cat "$mount_point/mems" \> "$path/mems"
>> +        else
>> +            ROD cat "$mount_point/cpuset.cpus" \> "$path/cpuset.cpus"
>> +            ROD cat "$mount_point/cpuset.mems" \> "$path/cpuset.mems"
>> +        fi
>>       fi
>>   }
>>   
>> --
>> 1.7.9.5
>>
>>
>> --
>> Mailing list info: https://lists.linux.it/listinfo/ltp
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP]  [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue
@ 2016-07-12 15:43 shuang.qiu
  2016-07-13 13:31 ` Jan Stancek
  0 siblings, 1 reply; 5+ messages in thread
From: shuang.qiu @ 2016-07-12 15:43 UTC (permalink / raw)
  To: ltp

From: Shuang Qiu <shuang.qiu@oracle.com>

As the legacy of:
  commit 8793d854edbc2774943a4b0de3304dc73991159a
  Author: Paul Menage <menage@google.com>
  Date:   Thu Oct 18 23:39:39 2007 -0700
  Task Control Groups: make cpusets a client of cgroups
there is no cpuset. prefix for cpuset subsystem if ever mount it as cpuset type.
So try either $mount_point/XXXX or $mount_point/cpuset.XXXX.

Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
---
 .../controllers/cgroup_fj/cgroup_fj_common.sh      |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
index df2cbfc..13e2938 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
@@ -69,8 +69,13 @@ create_subgroup()
     # cpuset.cpus and cpuset.mems must be initialized with suitable value
     # before any pids are attached
     if [ "$subsystem" == "cpuset" ]; then
-        ROD cat "$mount_point/cpuset.cpus" \> "$path/cpuset.cpus"
-        ROD cat "$mount_point/cpuset.mems" \> "$path/cpuset.mems"
+        if [ -e "$mount_point/cpus" ]; then
+            ROD cat "$mount_point/cpus" \> "$path/cpus"
+            ROD cat "$mount_point/mems" \> "$path/mems"
+        else
+            ROD cat "$mount_point/cpuset.cpus" \> "$path/cpuset.cpus"
+            ROD cat "$mount_point/cpuset.mems" \> "$path/cpuset.mems"
+        fi
     fi
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue
  2016-07-12 15:43 shuang.qiu
@ 2016-07-13 13:31 ` Jan Stancek
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Stancek @ 2016-07-13 13:31 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> From: "shuang qiu" <shuang.qiu@oracle.com>
> To: ltp@lists.linux.it
> Sent: Tuesday, 12 July, 2016 5:43:41 PM
> Subject: [LTP]  [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue
> 
> From: Shuang Qiu <shuang.qiu@oracle.com>
> 
> As the legacy of:
>   commit 8793d854edbc2774943a4b0de3304dc73991159a
>   Author: Paul Menage <menage@google.com>
>   Date:   Thu Oct 18 23:39:39 2007 -0700
>   Task Control Groups: make cpusets a client of cgroups
> there is no cpuset. prefix for cpuset subsystem if ever mount it as cpuset
> type.
> So try either $mount_point/XXXX or $mount_point/cpuset.XXXX.
> 
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>

Pushed with small tweaks to commit message.

Regards,
Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-13 13:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-08  6:49 [LTP] [PATCH] cgroup_fj/cgroup_fj_common.sh:cpuset prefix issue shuang.qiu
2016-07-11 13:12 ` Jan Stancek
2016-07-12 15:42   ` Shuang Qiu
  -- strict thread matches above, loose matches on Subject: below --
2016-07-12 15:43 shuang.qiu
2016-07-13 13:31 ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox