[LTP] [PATCH] memcg_process: cleanup the SHM segment

Stanislav Kholmanskikh stanislav.kholmanskikh@oracle.com
Thu Sep 8 11:39:43 CEST 2016


Hi

On 09/06/2016 07:01 PM, Cyril Hrubis wrote:
> Hi!
>> Let's mark the segment for removal right after we attach it.
>> This way memcg* test cases will no longer leave unused
>> segments after they finish.
>>
>> Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
>> ---
>>  .../controllers/memcg/functional/memcg_process.c   |    9 ++++-----
>>  1 files changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/testcases/kernel/controllers/memcg/functional/memcg_process.c b/testcases/kernel/controllers/memcg/functional/memcg_process.c
>> index fbb76e2..e2c60de 100644
>> --- a/testcases/kernel/controllers/memcg/functional/memcg_process.c
>> +++ b/testcases/kernel/controllers/memcg/functional/memcg_process.c
>> @@ -234,9 +234,6 @@ static void shm(void)
>>  		if (key == -1)
>>  			err(1, "ftok() failed");
>>  
>> -		shmid = shmget(key, memsize, flag);
>> -		if (shmid == -1)
>> -			err(1, "shmget() failed");
>>  		shmctl(shmid, IPC_RMID, NULL);
>                      ^
> Shouldn't we remove this IPC_RMID as well?
> 

Agreed. It's better to remove it.

> 
> Otherwise it looks fine.
> 

Pushed with the removal of the above IPC_RMID call.

Thank you.


More information about the ltp mailing list