public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] memcg_move_charge_at_immigrate_test: fix a bug of usage_in_bytes is not 'exact'
@ 2012-04-24  7:43 Peng Haitao
  2012-04-25  3:06 ` Wanlong Gao
  0 siblings, 1 reply; 5+ messages in thread
From: Peng Haitao @ 2012-04-24  7:43 UTC (permalink / raw)
  To: ltp-list

In memory.txt says:
 usage_in_bytes is affected by the method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz value for efficient access. (Of course, when necessary, it's synchronized.) If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) value in memory.stat(see 5.2).

So memory.usage_in_bytes should be replaced with memory.stat in the case of
memcg_move_charge_at_immigrate_test.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 testcases/kernel/controllers/memcg/functional/memcg_lib.sh     |    6 ++++--
 .../memcg/functional/memcg_move_charge_at_immigrate_test.sh    |    8 ++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
index 470932d..fd2c7fd 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
@@ -380,9 +380,11 @@ test_move_charge()
 	echo $! > subgroup_b/tasks
 
 	cd subgroup_b
-	check_mem_stat memory.usage_in_bytes $4
+	check_mem_stat "rss" $4
+	check_mem_stat "cache" $5
 	cd ../subgroup_a
-	check_mem_stat memory.usage_in_bytes $5
+	check_mem_stat "rss" $6
+	check_mem_stat "cache" $7
 
 	cd ..
 	echo $! > tasks
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
index fb639c7..cf2c603 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
@@ -35,27 +35,27 @@ export TST_COUNT=0
 # Test disable moving charges
 testcase_1()
 {
-	test_move_charge "--mmap-anon" $PAGESIZE  0 0 $PAGESIZE
+	test_move_charge "--mmap-anon" $PAGESIZE  0 0 0 $PAGESIZE 0
 }
 
 # Test move anon
 testcase_2()
 {
 	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE 1 \
-		$PAGESIZE $((PAGESIZE*2))
+		$PAGESIZE 0 0 $((PAGESIZE*2))
 }
 
 # Test move file
 testcase_3()
 {
 	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE 2 \
-		$((PAGESIZE*2)) $PAGESIZE
+		0 $((PAGESIZE*2)) $PAGESIZE 0
 }
 
 # Test move anon and file
 testcase_4()
 {
-	test_move_charge "--mmap-anon --shm" $PAGESIZE 3 $((PAGESIZE*2)) 0
+	test_move_charge "--mmap-anon --shm" $PAGESIZE 3 $PAGESIZE $PAGESIZE 0 0
 }
 
 # Run all the test cases
-- 
1.7.10


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] memcg_move_charge_at_immigrate_test: fix a bug of usage_in_bytes is not 'exact'
  2012-04-24  7:43 [LTP] [PATCH] memcg_move_charge_at_immigrate_test: fix a bug of usage_in_bytes is not 'exact' Peng Haitao
@ 2012-04-25  3:06 ` Wanlong Gao
  2012-04-25  3:32   ` Caspar Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Wanlong Gao @ 2012-04-25  3:06 UTC (permalink / raw)
  To: Peng Haitao; +Cc: ltp-list

On 04/24/2012 03:43 PM, Peng Haitao wrote:

> In memory.txt says:
>  usage_in_bytes is affected by the method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz value for efficient access. (Of course, when necessary, it's synchronized.) If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) value in memory.stat(see 5.2).
> 
> So memory.usage_in_bytes should be replaced with memory.stat in the case of
> memcg_move_charge_at_immigrate_test.
> 
> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>


pushed, thanks Peng,

Wanlong Gao

> ---
>  testcases/kernel/controllers/memcg/functional/memcg_lib.sh     |    6 ++++--
>  .../memcg/functional/memcg_move_charge_at_immigrate_test.sh    |    8 ++++----
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
> index 470932d..fd2c7fd 100755
> --- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
> +++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
> @@ -380,9 +380,11 @@ test_move_charge()
>  	echo $! > subgroup_b/tasks
>  
>  	cd subgroup_b
> -	check_mem_stat memory.usage_in_bytes $4
> +	check_mem_stat "rss" $4
> +	check_mem_stat "cache" $5
>  	cd ../subgroup_a
> -	check_mem_stat memory.usage_in_bytes $5
> +	check_mem_stat "rss" $6
> +	check_mem_stat "cache" $7
>  
>  	cd ..
>  	echo $! > tasks
> diff --git a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
> index fb639c7..cf2c603 100755
> --- a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
> +++ b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
> @@ -35,27 +35,27 @@ export TST_COUNT=0
>  # Test disable moving charges
>  testcase_1()
>  {
> -	test_move_charge "--mmap-anon" $PAGESIZE  0 0 $PAGESIZE
> +	test_move_charge "--mmap-anon" $PAGESIZE  0 0 0 $PAGESIZE 0
>  }
>  
>  # Test move anon
>  testcase_2()
>  {
>  	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE 1 \
> -		$PAGESIZE $((PAGESIZE*2))
> +		$PAGESIZE 0 0 $((PAGESIZE*2))
>  }
>  
>  # Test move file
>  testcase_3()
>  {
>  	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE 2 \
> -		$((PAGESIZE*2)) $PAGESIZE
> +		0 $((PAGESIZE*2)) $PAGESIZE 0
>  }
>  
>  # Test move anon and file
>  testcase_4()
>  {
> -	test_move_charge "--mmap-anon --shm" $PAGESIZE 3 $((PAGESIZE*2)) 0
> +	test_move_charge "--mmap-anon --shm" $PAGESIZE 3 $PAGESIZE $PAGESIZE 0 0
>  }
>  
>  # Run all the test cases



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] memcg_move_charge_at_immigrate_test: fix a bug of usage_in_bytes is not 'exact'
  2012-04-25  3:06 ` Wanlong Gao
@ 2012-04-25  3:32   ` Caspar Zhang
  2012-04-25  3:34     ` Caspar Zhang
  2012-04-25  3:39     ` Peng Haitao
  0 siblings, 2 replies; 5+ messages in thread
From: Caspar Zhang @ 2012-04-25  3:32 UTC (permalink / raw)
  To: Peng Haitao; +Cc: ltp-list

On 04/25/2012 11:06 AM, Wanlong Gao wrote:
> On 04/24/2012 03:43 PM, Peng Haitao wrote:
> 
>> In memory.txt says:
>>  usage_in_bytes is affected by the method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz value for efficient access. (Of course, when necessary, it's synchronized.) If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) value in memory.stat(see 5.2).
>>
>> So memory.usage_in_bytes should be replaced with memory.stat in the case of
>> memcg_move_charge_at_immigrate_test.

Hi, Please break your commit message into <= 73 words per line (except
some running output) next time.

Thanks,
Caspar

>>
>> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
> 
> 
> pushed, thanks Peng,
> 
> Wanlong Gao
> 
>> ---
>>  testcases/kernel/controllers/memcg/functional/memcg_lib.sh     |    6 ++++--
>>  .../memcg/functional/memcg_move_charge_at_immigrate_test.sh    |    8 ++++----
>>  2 files changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
>> index 470932d..fd2c7fd 100755
>> --- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
>> +++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
>> @@ -380,9 +380,11 @@ test_move_charge()
>>  	echo $! > subgroup_b/tasks
>>  
>>  	cd subgroup_b
>> -	check_mem_stat memory.usage_in_bytes $4
>> +	check_mem_stat "rss" $4
>> +	check_mem_stat "cache" $5
>>  	cd ../subgroup_a
>> -	check_mem_stat memory.usage_in_bytes $5
>> +	check_mem_stat "rss" $6
>> +	check_mem_stat "cache" $7
>>  
>>  	cd ..
>>  	echo $! > tasks
>> diff --git a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
>> index fb639c7..cf2c603 100755
>> --- a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
>> +++ b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
>> @@ -35,27 +35,27 @@ export TST_COUNT=0
>>  # Test disable moving charges
>>  testcase_1()
>>  {
>> -	test_move_charge "--mmap-anon" $PAGESIZE  0 0 $PAGESIZE
>> +	test_move_charge "--mmap-anon" $PAGESIZE  0 0 0 $PAGESIZE 0
>>  }
>>  
>>  # Test move anon
>>  testcase_2()
>>  {
>>  	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE 1 \
>> -		$PAGESIZE $((PAGESIZE*2))
>> +		$PAGESIZE 0 0 $((PAGESIZE*2))
>>  }
>>  
>>  # Test move file
>>  testcase_3()
>>  {
>>  	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE 2 \
>> -		$((PAGESIZE*2)) $PAGESIZE
>> +		0 $((PAGESIZE*2)) $PAGESIZE 0
>>  }
>>  
>>  # Test move anon and file
>>  testcase_4()
>>  {
>> -	test_move_charge "--mmap-anon --shm" $PAGESIZE 3 $((PAGESIZE*2)) 0
>> +	test_move_charge "--mmap-anon --shm" $PAGESIZE 3 $PAGESIZE $PAGESIZE 0 0
>>  }
>>  
>>  # Run all the test cases
> 
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] memcg_move_charge_at_immigrate_test: fix a bug of usage_in_bytes is not 'exact'
  2012-04-25  3:32   ` Caspar Zhang
@ 2012-04-25  3:34     ` Caspar Zhang
  2012-04-25  3:39     ` Peng Haitao
  1 sibling, 0 replies; 5+ messages in thread
From: Caspar Zhang @ 2012-04-25  3:34 UTC (permalink / raw)
  To: Peng Haitao; +Cc: ltp-list

On 04/25/2012 11:32 AM, Caspar Zhang wrote:
> On 04/25/2012 11:06 AM, Wanlong Gao wrote:
>> On 04/24/2012 03:43 PM, Peng Haitao wrote:
>>
>>> In memory.txt says:
>>>  usage_in_bytes is affected by the method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz value for efficient access. (Of course, when necessary, it's synchronized.) If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) value in memory.stat(see 5.2).
>>>
>>> So memory.usage_in_bytes should be replaced with memory.stat in the case of
>>> memcg_move_charge_at_immigrate_test.
> 
> Hi, Please break your commit message into <= 73 words per line (except

sorry, s/words/characters...

> some running output) next time.
> 
> Thanks,
> Caspar

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] memcg_move_charge_at_immigrate_test: fix a bug of usage_in_bytes is not 'exact'
  2012-04-25  3:32   ` Caspar Zhang
  2012-04-25  3:34     ` Caspar Zhang
@ 2012-04-25  3:39     ` Peng Haitao
  1 sibling, 0 replies; 5+ messages in thread
From: Peng Haitao @ 2012-04-25  3:39 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: ltp-list


Caspar Zhang said the following on 2012-4-25 11:32:
>>> In memory.txt says:
>>>  usage_in_bytes is affected by the method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz value for efficient access. (Of course, when necessary, it's synchronized.) If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) value in memory.stat(see 5.2).
>>>
>>> So memory.usage_in_bytes should be replaced with memory.stat in the case of
>>> memcg_move_charge_at_immigrate_test.
> 
> Hi, Please break your commit message into <= 73 words per line (except
> some running output) next time.
> 

Sorry,I see。

Thanks。

-- 
Best Regards,
Peng

> Thanks,
> Caspar
> 
>>>
>>> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
>>
>>
>> pushed, thanks Peng,
>>
>> Wanlong Gao
>>
>>> ---
>>>  testcases/kernel/controllers/memcg/functional/memcg_lib.sh     |    6 ++++--
>>>  .../memcg/functional/memcg_move_charge_at_immigrate_test.sh    |    8 ++++----
>>>  2 files changed, 8 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
>>> index 470932d..fd2c7fd 100755
>>> --- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
>>> +++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
>>> @@ -380,9 +380,11 @@ test_move_charge()
>>>  	echo $! > subgroup_b/tasks
>>>  
>>>  	cd subgroup_b
>>> -	check_mem_stat memory.usage_in_bytes $4
>>> +	check_mem_stat "rss" $4
>>> +	check_mem_stat "cache" $5
>>>  	cd ../subgroup_a
>>> -	check_mem_stat memory.usage_in_bytes $5
>>> +	check_mem_stat "rss" $6
>>> +	check_mem_stat "cache" $7
>>>  
>>>  	cd ..
>>>  	echo $! > tasks
>>> diff --git a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
>>> index fb639c7..cf2c603 100755
>>> --- a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
>>> +++ b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
>>> @@ -35,27 +35,27 @@ export TST_COUNT=0
>>>  # Test disable moving charges
>>>  testcase_1()
>>>  {
>>> -	test_move_charge "--mmap-anon" $PAGESIZE  0 0 $PAGESIZE
>>> +	test_move_charge "--mmap-anon" $PAGESIZE  0 0 0 $PAGESIZE 0
>>>  }
>>>  
>>>  # Test move anon
>>>  testcase_2()
>>>  {
>>>  	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE 1 \
>>> -		$PAGESIZE $((PAGESIZE*2))
>>> +		$PAGESIZE 0 0 $((PAGESIZE*2))
>>>  }
>>>  
>>>  # Test move file
>>>  testcase_3()
>>>  {
>>>  	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE 2 \
>>> -		$((PAGESIZE*2)) $PAGESIZE
>>> +		0 $((PAGESIZE*2)) $PAGESIZE 0
>>>  }
>>>  
>>>  # Test move anon and file
>>>  testcase_4()
>>>  {
>>> -	test_move_charge "--mmap-anon --shm" $PAGESIZE 3 $((PAGESIZE*2)) 0
>>> +	test_move_charge "--mmap-anon --shm" $PAGESIZE 3 $PAGESIZE $PAGESIZE 0 0
>>>  }
>>>  
>>>  # Run all the test cases
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and 
>> threat landscape has changed and how IT managers can respond. Discussions 
>> will include endpoint security, mobile security and the latest in malware 
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Ltp-list mailing list
>> Ltp-list@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 
> 
> 



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2012-04-25  3:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24  7:43 [LTP] [PATCH] memcg_move_charge_at_immigrate_test: fix a bug of usage_in_bytes is not 'exact' Peng Haitao
2012-04-25  3:06 ` Wanlong Gao
2012-04-25  3:32   ` Caspar Zhang
2012-04-25  3:34     ` Caspar Zhang
2012-04-25  3:39     ` Peng Haitao

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