All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
@ 2015-03-20  5:28 Satish Gedela
  2015-03-20  8:11 ` Jan Stancek
  0 siblings, 1 reply; 7+ messages in thread
From: Satish Gedela @ 2015-03-20  5:28 UTC (permalink / raw)
  To: ltp-list

Dear all,

I am newbie to open source, forgive me with text format 
I am trying to run  LTP with kernel 3.16 on target board having cortex A9  processor ,
Facing issue with below test case: 
Test script  name: "memcg_function_test.sh"
Test case description:  "Test mmap(locked) + alloc_mem > limit_in_bytes"

Analysis:  memcg_function_test.sh   -----> test_proc_kill
						                  ------->memcg_lib.sh
									             -------->memcg_process
    memcg_process ------>ltp/testcases/kernel/controllers/memcg/functional/memcg_process.c
  
mmap_lock1 () function is calling in memcg_process.c and 
it calls mmap function with flags MAP_PRIVATE | MAP_ANYNOMOUS | MAP_LOCKED
{noformat}
p = mmap(NULL, memsize, PROT_WRITE | PROT_READ,
      MAP_PRIVATE | MAP_LOCKED, 0, 0);          
{noformat}

but man page of mmap is mentioned as:
{noformat} 
MAP_ANONYMOUS
        The  mapping  is  not  backed  by  any  file; its contents are initialized to zero.  The fd and offset arguments are
        ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified, and portable
        applications should ensure this.  The use of MAP_ANONYMOUS in conjunction with MAP_SHARED is only supported on Linux
        since kernel 2.4.
{noformat}

In my case, we are trying to lock the pages with flags  MAP_PRIVATE | MAP_ANYNOMOUS |  MAP_LOCKED  and  it is failing.
and with  MAP_SHARED | MAP_ANYNOMOUS |  MAP_LOCKED , it is failing
but with MAP_PRIVATE | MAP_LOCKED and 
with MAP_SHARED | MAP_LOCKED it is working.

Is there any changes made to kernel or 
test case has to update with MAP_SHARED instead of MAP_PRIVATE flag.

Thank you in advance.
Regards
Satish.G

   





    																															 



  

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
  2015-03-20  5:28 [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS Satish Gedela
@ 2015-03-20  8:11 ` Jan Stancek
  2015-03-20 11:42   ` Satish Gedela
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Stancek @ 2015-03-20  8:11 UTC (permalink / raw)
  To: Satish Gedela; +Cc: ltp-list



----- Original Message -----
> From: "Satish Gedela" <satish.gedela@lge.com>
> To: ltp-list@lists.sourceforge.net
> Sent: Friday, 20 March, 2015 6:28:34 AM
> Subject: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
> 
> Dear all,
> 
> I am newbie to open source, forgive me with text format
> I am trying to run  LTP with kernel 3.16 on target board having cortex A9
> processor ,
> Facing issue with below test case:
> Test script  name: "memcg_function_test.sh"
> Test case description:  "Test mmap(locked) + alloc_mem > limit_in_bytes"
> 
> Analysis:  memcg_function_test.sh   -----> test_proc_kill
> 						                  ------->memcg_lib.sh
> 									             -------->memcg_process
>     memcg_process
>     ------>ltp/testcases/kernel/controllers/memcg/functional/memcg_process.c
>   
> mmap_lock1 () function is calling in memcg_process.c and
> it calls mmap function with flags MAP_PRIVATE | MAP_ANYNOMOUS | MAP_LOCKED
> {noformat}
> p = mmap(NULL, memsize, PROT_WRITE | PROT_READ,
>       MAP_PRIVATE | MAP_LOCKED, 0, 0);
> {noformat}
> 
> but man page of mmap is mentioned as:
> {noformat}
> MAP_ANONYMOUS
>         The  mapping  is  not  backed  by  any  file; its contents are
>         initialized to zero.  The fd and offset arguments are
>         ignored; however, some implementations require fd to be -1 if
>         MAP_ANONYMOUS (or MAP_ANON) is specified, and portable
>         applications should ensure this.  The use of MAP_ANONYMOUS in
>         conjunction with MAP_SHARED is only supported on Linux
>         since kernel 2.4.
> {noformat}
> 
> In my case, we are trying to lock the pages with flags  MAP_PRIVATE |
> MAP_ANYNOMOUS |  MAP_LOCKED  and  it is failing.

Hi,

failing how? EINVAL or something else?
Do you see mmap14 failing as well? If so, can you run it via strace?

Regards,
Jan

> and with  MAP_SHARED | MAP_ANYNOMOUS |  MAP_LOCKED , it is failing
> but with MAP_PRIVATE | MAP_LOCKED and
> with MAP_SHARED | MAP_LOCKED it is working.
> 
> Is there any changes made to kernel or
> test case has to update with MAP_SHARED instead of MAP_PRIVATE flag.
> 
> Thank you in advance.
> Regards
> Satish.G
> 
>    
> 
> 
> 
> 
> 
>     																															 
> 
> 
> 
>   
> 
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
  2015-03-20  8:11 ` Jan Stancek
@ 2015-03-20 11:42   ` Satish Gedela
  2015-03-20 13:13     ` Jan Stancek
  0 siblings, 1 reply; 7+ messages in thread
From: Satish Gedela @ 2015-03-20 11:42 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list



> -----Original Message-----
> From: Jan Stancek [mailto:jstancek@redhat.com]
> Sent: Friday, March 20, 2015 1:41 PM
> To: Satish Gedela/LGSIA CSP-2(satish.gedela@lge.com)
> Cc: ltp-list@lists.sourceforge.net
> Subject: Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
> 
> 
> 
> ----- Original Message -----
> > From: "Satish Gedela" <satish.gedela@lge.com>
> > To: ltp-list@lists.sourceforge.net
> > Sent: Friday, 20 March, 2015 6:28:34 AM
> > Subject: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
> >
> > Dear all,
> >
> > I am newbie to open source, forgive me with text format I am trying to
> > run  LTP with kernel 3.16 on target board having cortex A9 processor ,
> > Facing issue with below test case:
> > Test script  name: "memcg_function_test.sh"
> > Test case description:  "Test mmap(locked) + alloc_mem > limit_in_bytes"
> >
> > Analysis:  memcg_function_test.sh   -----> test_proc_kill
> > 						                  ------->memcg_lib.sh
> >
> -------->memcg_process
> >     memcg_process
> >
> > ------>ltp/testcases/kernel/controllers/memcg/functional/memcg_process
> > .c
> >
> > mmap_lock1 () function is calling in memcg_process.c and it calls mmap
> > function with flags MAP_PRIVATE | MAP_ANYNOMOUS | MAP_LOCKED
> > {noformat} p = mmap(NULL, memsize, PROT_WRITE | PROT_READ,
> >       MAP_PRIVATE | MAP_LOCKED, 0, 0); {noformat}
> >
> > but man page of mmap is mentioned as:
> > {noformat}
> > MAP_ANONYMOUS
> >         The  mapping  is  not  backed  by  any  file; its contents are
> >         initialized to zero.  The fd and offset arguments are
> >         ignored; however, some implementations require fd to be -1 if
> >         MAP_ANONYMOUS (or MAP_ANON) is specified, and portable
> >         applications should ensure this.  The use of MAP_ANONYMOUS in
> >         conjunction with MAP_SHARED is only supported on Linux
> >         since kernel 2.4.
> > {noformat}
> >
> > In my case, we are trying to lock the pages with flags  MAP_PRIVATE |
> > MAP_ANYNOMOUS |  MAP_LOCKED  and  it is failing.
> 
> Hi,
> 
> failing how? EINVAL or something else?
> Do you see mmap14 failing as well? If so, can you run it via strace?
> 
> Regards,
> Jan
> 
Hi Jan,
Failing  to kill process PID.
Not getting EINVAL 
I did not test mmap14 but I replaced 5th argument with  '-1' instead of '0' (Based on mmap14 test case)
still getting test case failure.

Test procedure followed:

Test case description : "kill the process if memory limit exceeds , 
Process memory locked through MAP_LOCKED  in test_ case_ 14 and using mlock() in test_case_ 15"

Running LTP on work station using
	$make configure
	$make 
	$make install
And copy ltp , kernel, sysinfo.sh, tools  into target directory " /opt " 
and on target running below commnad

#./runltp -f controllers  > log.txt

From log report, identified mmap-lock1 (MAP_LOCKED)  is failing and mmap-lock2 (mlock2)  is passing 
So from the memcg_process.c file
	mmap_lock1() is using mmap () with MAP_PRIVATE | MAP_ANYNOMOUS | MAP_LOCKED
	mmap_lock2 is using mmap () with MAP_PRIVATE | MAP_ANYNOMOUS 
	and mlock() function call.

 In process of debugging, I replaced mmap_lock1 with mmap_lock2 , in test _case_ 14 and it is working successfully.
So I identified issue is in mmap() call and 
replaced flag as "MAP_SHARED | MAP_LOCKED"  and  "MAP_PRIVATE  | MAP_LOCKED "in mmap, 
it is working successfully in both cases but not with MAP_ANYNOMOUS flag.

Regards
Satish.G

> > and with  MAP_SHARED | MAP_ANYNOMOUS |  MAP_LOCKED , it is failing
> but
> > with MAP_PRIVATE | MAP_LOCKED and with MAP_SHARED |
> MAP_LOCKED it is
> > working.
> >
> > Is there any changes made to kernel or test case has to update with
> > MAP_SHARED instead of MAP_PRIVATE flag.
> >
> > Thank you in advance.
> > Regards
> > Satish.G
> >
> >
> >
> >
> >
> >
> >
> >
> 
> 
> 
> >
> >
> >
> >
> >
> > ----------------------------------------------------------------------
> > -------- Dive into the World of Parallel Programming The Go Parallel
> > Website, sponsored by Intel and developed in partnership with Slashdot
> > Media, is your hub for all things parallel software development, from
> > weekly thought leadership blogs to news, videos, case studies,
> > tutorials and more. Take a look and join the conversation now.
> > http://goparallel.sourceforge.net/
> > _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> >
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
  2015-03-20 11:42   ` Satish Gedela
@ 2015-03-20 13:13     ` Jan Stancek
  2015-03-20 14:06       ` Carmelo Amoroso
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Stancek @ 2015-03-20 13:13 UTC (permalink / raw)
  To: Satish Gedela; +Cc: ltp-list





----- Original Message -----
> From: "Satish Gedela" <satish.gedela@lge.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp-list@lists.sourceforge.net
> Sent: Friday, 20 March, 2015 12:42:00 PM
> Subject: RE: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
> 
> 
> 
> > -----Original Message-----
> > From: Jan Stancek [mailto:jstancek@redhat.com]
> > Sent: Friday, March 20, 2015 1:41 PM
> > To: Satish Gedela/LGSIA CSP-2(satish.gedela@lge.com)
> > Cc: ltp-list@lists.sourceforge.net
> > Subject: Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
> > 
> > 
> > 
> > ----- Original Message -----
> > > From: "Satish Gedela" <satish.gedela@lge.com>
> > > To: ltp-list@lists.sourceforge.net
> > > Sent: Friday, 20 March, 2015 6:28:34 AM
> > > Subject: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
> > >
> > > Dear all,
> > >
> > > I am newbie to open source, forgive me with text format I am trying to
> > > run  LTP with kernel 3.16 on target board having cortex A9 processor ,
> > > Facing issue with below test case:
> > > Test script  name: "memcg_function_test.sh"
> > > Test case description:  "Test mmap(locked) + alloc_mem > limit_in_bytes"
> > >
> > > Analysis:  memcg_function_test.sh   -----> test_proc_kill
> > > 						                  ------->memcg_lib.sh
> > >
> > -------->memcg_process
> > >     memcg_process
> > >
> > > ------>ltp/testcases/kernel/controllers/memcg/functional/memcg_process
> > > .c
> > >
> > > mmap_lock1 () function is calling in memcg_process.c and it calls mmap
> > > function with flags MAP_PRIVATE | MAP_ANYNOMOUS | MAP_LOCKED
> > > {noformat} p = mmap(NULL, memsize, PROT_WRITE | PROT_READ,
> > >       MAP_PRIVATE | MAP_LOCKED, 0, 0); {noformat}
> > >
> > > but man page of mmap is mentioned as:
> > > {noformat}
> > > MAP_ANONYMOUS
> > >         The  mapping  is  not  backed  by  any  file; its contents are
> > >         initialized to zero.  The fd and offset arguments are
> > >         ignored; however, some implementations require fd to be -1 if
> > >         MAP_ANONYMOUS (or MAP_ANON) is specified, and portable
> > >         applications should ensure this.  The use of MAP_ANONYMOUS in
> > >         conjunction with MAP_SHARED is only supported on Linux
> > >         since kernel 2.4.
> > > {noformat}
> > >
> > > In my case, we are trying to lock the pages with flags  MAP_PRIVATE |
> > > MAP_ANYNOMOUS |  MAP_LOCKED  and  it is failing.
> > 
> > Hi,
> > 
> > failing how? EINVAL or something else?
> > Do you see mmap14 failing as well? If so, can you run it via strace?
> > 
> > Regards,
> > Jan
> > 
> Hi Jan,
> Failing  to kill process PID.

It seems that MAP_LOCKED can now silently fail.

https://lkml.org/lkml/2015/1/19/28
http://marc.info/?l=linux-mm&m=142122902313315&w=2

Those posts contain also kernel commit IDs that are likely responsible
for same problem you see.

Regards,
Jan

> Not getting EINVAL
> I did not test mmap14 but I replaced 5th argument with  '-1' instead of '0'
> (Based on mmap14 test case)
> still getting test case failure.
> 
> Test procedure followed:
> 
> Test case description : "kill the process if memory limit exceeds ,
> Process memory locked through MAP_LOCKED  in test_ case_ 14 and using mlock()
> in test_case_ 15"
> 
> Running LTP on work station using
> 	$make configure
> 	$make
> 	$make install
> And copy ltp , kernel, sysinfo.sh, tools  into target directory " /opt "
> and on target running below commnad
> 
> #./runltp -f controllers  > log.txt
> 
> From log report, identified mmap-lock1 (MAP_LOCKED)  is failing and
> mmap-lock2 (mlock2)  is passing
> So from the memcg_process.c file
> 	mmap_lock1() is using mmap () with MAP_PRIVATE | MAP_ANYNOMOUS | MAP_LOCKED
> 	mmap_lock2 is using mmap () with MAP_PRIVATE | MAP_ANYNOMOUS
> 	and mlock() function call.
> 
>  In process of debugging, I replaced mmap_lock1 with mmap_lock2 , in test
>  _case_ 14 and it is working successfully.
> So I identified issue is in mmap() call and
> replaced flag as "MAP_SHARED | MAP_LOCKED"  and  "MAP_PRIVATE  | MAP_LOCKED
> "in mmap,
> it is working successfully in both cases but not with MAP_ANYNOMOUS flag.
> 
> Regards
> Satish.G
> 
> > > and with  MAP_SHARED | MAP_ANYNOMOUS |  MAP_LOCKED , it is failing
> > but
> > > with MAP_PRIVATE | MAP_LOCKED and with MAP_SHARED |
> > MAP_LOCKED it is
> > > working.
> > >
> > > Is there any changes made to kernel or test case has to update with
> > > MAP_SHARED instead of MAP_PRIVATE flag.
> > >
> > > Thank you in advance.
> > > Regards
> > > Satish.G
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > 
> > 
> > 
> > >
> > >
> > >
> > >
> > >
> > > ----------------------------------------------------------------------
> > > -------- Dive into the World of Parallel Programming The Go Parallel
> > > Website, sponsored by Intel and developed in partnership with Slashdot
> > > Media, is your hub for all things parallel software development, from
> > > weekly thought leadership blogs to news, videos, case studies,
> > > tutorials and more. Take a look and join the conversation now.
> > > http://goparallel.sourceforge.net/
> > > _______________________________________________
> > > Ltp-list mailing list
> > > Ltp-list@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > >
> 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
  2015-03-20 13:13     ` Jan Stancek
@ 2015-03-20 14:06       ` Carmelo Amoroso
  2015-03-22  6:43         ` Mike Frysinger
  0 siblings, 1 reply; 7+ messages in thread
From: Carmelo Amoroso @ 2015-03-20 14:06 UTC (permalink / raw)
  To: ltp-list

Hello,

On 3/20/2015 2:13 PM, Jan Stancek wrote:
>
>
>
>
> ----- Original Message -----
>> From: "Satish Gedela" <satish.gedela@lge.com>
>> To: "Jan Stancek" <jstancek@redhat.com>
>> Cc: ltp-list@lists.sourceforge.net
>> Sent: Friday, 20 March, 2015 12:42:00 PM
>> Subject: RE: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
>>
>>
>>
>>> -----Original Message-----
>>> From: Jan Stancek [mailto:jstancek@redhat.com]
>>> Sent: Friday, March 20, 2015 1:41 PM
>>> To: Satish Gedela/LGSIA CSP-2(satish.gedela@lge.com)
>>> Cc: ltp-list@lists.sourceforge.net
>>> Subject: Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
>>>
>>>
>>>
>>> ----- Original Message -----
>>>> From: "Satish Gedela" <satish.gedela@lge.com>
>>>> To: ltp-list@lists.sourceforge.net
>>>> Sent: Friday, 20 March, 2015 6:28:34 AM
>>>> Subject: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
>>>>
>>>> Dear all,
>>>>
>>>> I am newbie to open source, forgive me with text format I am trying to
>>>> run  LTP with kernel 3.16 on target board having cortex A9 processor ,
>>>> Facing issue with below test case:
>>>> Test script  name: "memcg_function_test.sh"
>>>> Test case description:  "Test mmap(locked) + alloc_mem > limit_in_bytes"
>>>>
>>>> Analysis:  memcg_function_test.sh   -----> test_proc_kill
>>>> 						                  ------->memcg_lib.sh
>>>>
>>> -------->memcg_process
>>>>      memcg_process
>>>>
>>>> ------>ltp/testcases/kernel/controllers/memcg/functional/memcg_process
>>>> .c
>>>>
>>>> mmap_lock1 () function is calling in memcg_process.c and it calls mmap
>>>> function with flags MAP_PRIVATE | MAP_ANYNOMOUS | MAP_LOCKED
>>>> {noformat} p = mmap(NULL, memsize, PROT_WRITE | PROT_READ,
>>>>        MAP_PRIVATE | MAP_LOCKED, 0, 0); {noformat}
>>>>
>>>> but man page of mmap is mentioned as:
>>>> {noformat}
>>>> MAP_ANONYMOUS
>>>>          The  mapping  is  not  backed  by  any  file; its contents are
>>>>          initialized to zero.  The fd and offset arguments are
>>>>          ignored; however, some implementations require fd to be -1 if
>>>>          MAP_ANONYMOUS (or MAP_ANON) is specified, and portable
>>>>          applications should ensure this.  The use of MAP_ANONYMOUS in
>>>>          conjunction with MAP_SHARED is only supported on Linux
>>>>          since kernel 2.4.
>>>> {noformat}
>>>>
>>>> In my case, we are trying to lock the pages with flags  MAP_PRIVATE |
>>>> MAP_ANYNOMOUS |  MAP_LOCKED  and  it is failing.
>>>
>>> Hi,
>>>
>>> failing how? EINVAL or something else?
>>> Do you see mmap14 failing as well? If so, can you run it via strace?
>>>
>>> Regards,
>>> Jan
>>>
>> Hi Jan,
>> Failing  to kill process PID.
>
> It seems that MAP_LOCKED can now silently fail.
>
> https://lkml.org/lkml/2015/1/19/28
> http://marc.info/?l=linux-mm&m=142122902313315&w=2
>

I hit exactly the same issue on CA9 based platform when moved from 
kernel 3.10.53 to 3.10.65

> Those posts contain also kernel commit IDs that are likely responsible
> for same problem you see.
>

So, should the LTP be updated accordingly ?

> Regards,
> Jan
>

Thanks,
Carmelo

>> Not getting EINVAL
>> I did not test mmap14 but I replaced 5th argument with  '-1' instead of '0'
>> (Based on mmap14 test case)
>> still getting test case failure.
>>
>> Test procedure followed:
>>
>> Test case description : "kill the process if memory limit exceeds ,
>> Process memory locked through MAP_LOCKED  in test_ case_ 14 and using mlock()
>> in test_case_ 15"
>>
>> Running LTP on work station using
>> 	$make configure
>> 	$make
>> 	$make install
>> And copy ltp , kernel, sysinfo.sh, tools  into target directory " /opt "
>> and on target running below commnad
>>
>> #./runltp -f controllers  > log.txt
>>
>>  From log report, identified mmap-lock1 (MAP_LOCKED)  is failing and
>> mmap-lock2 (mlock2)  is passing
>> So from the memcg_process.c file
>> 	mmap_lock1() is using mmap () with MAP_PRIVATE | MAP_ANYNOMOUS | MAP_LOCKED
>> 	mmap_lock2 is using mmap () with MAP_PRIVATE | MAP_ANYNOMOUS
>> 	and mlock() function call.
>>
>>   In process of debugging, I replaced mmap_lock1 with mmap_lock2 , in test
>>   _case_ 14 and it is working successfully.
>> So I identified issue is in mmap() call and
>> replaced flag as "MAP_SHARED | MAP_LOCKED"  and  "MAP_PRIVATE  | MAP_LOCKED
>> "in mmap,
>> it is working successfully in both cases but not with MAP_ANYNOMOUS flag.
>>
>> Regards
>> Satish.G
>>
>>>> and with  MAP_SHARED | MAP_ANYNOMOUS |  MAP_LOCKED , it is failing
>>> but
>>>> with MAP_PRIVATE | MAP_LOCKED and with MAP_SHARED |
>>> MAP_LOCKED it is
>>>> working.
>>>>
>>>> Is there any changes made to kernel or test case has to update with
>>>> MAP_SHARED instead of MAP_PRIVATE flag.
>>>>
>>>> Thank you in advance.
>>>> Regards
>>>> Satish.G
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ----------------------------------------------------------------------
>>>> -------- Dive into the World of Parallel Programming The Go Parallel
>>>> Website, sponsored by Intel and developed in partnership with Slashdot
>>>> Media, is your hub for all things parallel software development, from
>>>> weekly thought leadership blogs to news, videos, case studies,
>>>> tutorials and more. Take a look and join the conversation now.
>>>> http://goparallel.sourceforge.net/
>>>> _______________________________________________
>>>> Ltp-list mailing list
>>>> Ltp-list@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/ltp-list
>>>>
>>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
  2015-03-20 14:06       ` Carmelo Amoroso
@ 2015-03-22  6:43         ` Mike Frysinger
  2015-03-23  6:53           ` Cyril Hrubis
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2015-03-22  6:43 UTC (permalink / raw)
  To: Carmelo Amoroso; +Cc: ltp-list


[-- Attachment #1.1: Type: text/plain, Size: 644 bytes --]

On 20 Mar 2015 15:06, Carmelo Amoroso wrote:
> On 3/20/2015 2:13 PM, Jan Stancek wrote:
> > It seems that MAP_LOCKED can now silently fail.
> >
> > https://lkml.org/lkml/2015/1/19/28
> > http://marc.info/?l=linux-mm&m=142122902313315&w=2
> 
> I hit exactly the same issue on CA9 based platform when moved from 
> kernel 3.10.53 to 3.10.65
> 
> > Those posts contain also kernel commit IDs that are likely responsible
> > for same problem you see.
> 
> So, should the LTP be updated accordingly ?

if the kernel has changed behavior, LTP needs to adapt to it (assuming the 
kernel people changed the behavior on purpose)
-mike

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 441 bytes --]

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS
  2015-03-22  6:43         ` Mike Frysinger
@ 2015-03-23  6:53           ` Cyril Hrubis
  0 siblings, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2015-03-23  6:53 UTC (permalink / raw)
  To: Carmelo Amoroso, ltp-list

Hi!
> > So, should the LTP be updated accordingly ?
> 
> if the kernel has changed behavior, LTP needs to adapt to it (assuming the 
> kernel people changed the behavior on purpose)

The kernel contradicts the manual page here and the change was
unintentional, it's side effect from fixes for deadlock.

Michal Hocko was looking into the issue, he said that they will likely
discuss it on LSMM. I will ask him if they agreed on what should be done
about it.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2015-03-23  6:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20  5:28 [LTP] MAP_LOCKED issue in mmap with MAP_ANYNOMOUS Satish Gedela
2015-03-20  8:11 ` Jan Stancek
2015-03-20 11:42   ` Satish Gedela
2015-03-20 13:13     ` Jan Stancek
2015-03-20 14:06       ` Carmelo Amoroso
2015-03-22  6:43         ` Mike Frysinger
2015-03-23  6:53           ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.