* Re: [LTP] [PATCH] memcg_function:fix the wrong use of mlock
[not found] <4EE95F75.6030909@cn.fujitsu.com>
@ 2011-12-15 3:05 ` Caspar Zhang
[not found] ` <4EE963A9.7030100@cn.fujitsu.com>
[not found] ` <6d5f6f84-cdfa-42d0-a3a5-f9d028419818@zmail16.collab.prod.int.phx2.redhat.com>
2 siblings, 0 replies; 4+ messages in thread
From: Caspar Zhang @ 2011-12-15 3:05 UTC (permalink / raw)
To: ltp-list
On 12/15/2011 10:46 AM, Peng Haitao wrote:
>
> mlock and munmap will return -1 when ERROR.
>
> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Nice catch.
Reviewed-by: Caspar Zhang <caspar@casparzhang.com>
> ---
> .../cpuset/cpuset_memory_test/cpuset_memory_test.c | 4 ++--
> .../controllers/memcg/functional/memcg_process.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_test.c b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_test.c
> index 8d37b24..512df3a 100644
> --- a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_test.c
> +++ b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_test.c
> @@ -196,7 +196,7 @@ void mmap_file(int flag_allocated)
> }
> touch_memory_and_echo_node(p, memsize);
> } else {
> - if (!munmap(p, memsize) == -1)
> + if (munmap(p, memsize) == -1)
> err(1, "munmap(file) failed");
>
> if (opt_hugepage) {
> @@ -236,7 +236,7 @@ void mmap_lock2(int flag_allocated)
> err(1, "mlock failed");
> touch_memory_and_echo_node(p, memsize);
> } else {
> - if (!munmap(p, memsize) == -1)
> + if (munmap(p, memsize) == -1)
> err(1, "munmap failed");
> }
> }
> diff --git a/testcases/kernel/controllers/memcg/functional/memcg_process.c b/testcases/kernel/controllers/memcg/functional/memcg_process.c
> index 4f8c257..37ded19 100644
> --- a/testcases/kernel/controllers/memcg/functional/memcg_process.c
> +++ b/testcases/kernel/controllers/memcg/functional/memcg_process.c
> @@ -167,7 +167,7 @@ void mmap_file()
> }
> touch_memory(p, memsize);
> } else {
> - if (!munmap(p, memsize) == -1)
> + if (munmap(p, memsize) == -1)
> err(1, "munmap(file) failed");
>
> if (opt_hugepage) {
> @@ -202,10 +202,10 @@ void mmap_lock2()
> if (p == MAP_FAILED)
> err(1, "mmap failed");
>
> - if (!mlock(p, memsize))
> + if (mlock(p, memsize) == -1)
> err(1, "mlock failed");
> } else {
> - if (!munmap(p, memsize) == -1)
> + if (munmap(p, memsize) == -1)
> err(1, "munmap failed");
> }
> }
------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.
But none more important than the need to reduce IT complexity
while improving strategic productivity. Learn More!
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] memcg_function:fix the wrong use of mlock
[not found] ` <4EE963A9.7030100@cn.fujitsu.com>
@ 2011-12-15 5:44 ` Garrett Cooper
2011-12-15 5:52 ` Wanlong Gao
0 siblings, 1 reply; 4+ messages in thread
From: Garrett Cooper @ 2011-12-15 5:44 UTC (permalink / raw)
To: gaowanlong; +Cc: LTP List
On Wed, Dec 14, 2011 at 7:04 PM, Wanlong Gao <gaowanlong@cn.fujitsu.com> wrote:
> On 12/15/2011 10:46 AM, Peng Haitao wrote:
>
>>
>> mlock and munmap will return -1 when ERROR.
>>
>> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
>
> Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Committed -- thanks!
-Garrett
------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.
But none more important than the need to reduce IT complexity
while improving strategic productivity. Learn More!
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] memcg_function:fix the wrong use of mlock
2011-12-15 5:44 ` Garrett Cooper
@ 2011-12-15 5:52 ` Wanlong Gao
0 siblings, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2011-12-15 5:52 UTC (permalink / raw)
To: Garrett Cooper; +Cc: LTP List
Hi Garrett:
What do you think about the patch set below now?
[PATCH 0/5] Automatically mount hugetlbfs for hugemmap tests.
Thanks a lot
-Wanlong Gao
> On Wed, Dec 14, 2011 at 7:04 PM, Wanlong Gao <gaowanlong@cn.fujitsu.com> wrote:
>> On 12/15/2011 10:46 AM, Peng Haitao wrote:
>>
>>>
>>> mlock and munmap will return -1 when ERROR.
>>>
>>> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
>>
>> Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
>
> Committed -- thanks!
> -Garrett
>
------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.
But none more important than the need to reduce IT complexity
while improving strategic productivity. Learn More!
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] memcg_function:fix the wrong use of mlock
[not found] ` <6d5f6f84-cdfa-42d0-a3a5-f9d028419818@zmail16.collab.prod.int.phx2.redhat.com>
@ 2011-12-21 14:09 ` Cyril Hrubis
0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2011-12-21 14:09 UTC (permalink / raw)
To: Jan Stancek; +Cc: LTP List
Hi!
> this should be commited already, but looking at git,
> I see changes only for memcg_process.c:
>
> commit 17ecdc4e0f895f61067a65d6105f29d4f55680be
> Author: Garrett Cooper <yanegomi@gmail.com>
> Date: Wed Dec 14 21:42:25 2011 -0800
>
> mlock and munmap will return -1 if they fail.
>
> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
> Reviewed-by: Caspar Zhang <caspar@casparzhang.com>
> Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
>
> .../controllers/memcg/functional/memcg_process.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> Have I missed some message on mailing list or did it slip by accident?
Looks like the second part is somehow missing.
Sigh, like when people are helping, but sometimes Garrett is actually
making my life harder...
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-21 13:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4EE95F75.6030909@cn.fujitsu.com>
2011-12-15 3:05 ` [LTP] [PATCH] memcg_function:fix the wrong use of mlock Caspar Zhang
[not found] ` <4EE963A9.7030100@cn.fujitsu.com>
2011-12-15 5:44 ` Garrett Cooper
2011-12-15 5:52 ` Wanlong Gao
[not found] ` <6d5f6f84-cdfa-42d0-a3a5-f9d028419818@zmail16.collab.prod.int.phx2.redhat.com>
2011-12-21 14:09 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox