[LTP] [PATCH] memcg/functional: check several times if the process is killed

Stanislav Kholmanskikh stanislav.kholmanskikh@oracle.com
Tue May 24 12:04:23 CEST 2016



On 05/24/2016 12:18 PM, Cyril Hrubis wrote:
> Hi!
>>>>   	$TEST_PATH/memcg_process $2 -s $3 &
>>>>   	pid=$!
>>>> -	sleep 1
>>>
>>> This sleep sure is useless.
>>
>> Isn't it there to make sure, that SIGUSR1 handler had time
>> to set up? (for example with single CPU and sched_child_runs_first == 0)
>
> Looking at the code, you are right.

Indeed. Thanks!


>
> We should better change this for something more robust. Given that the
> memgc_progcess does while (!flag_exit) sleep(1); in the main loop we may
> as well wait till the process gets into the sleep state.
>

I don't understand why it's more robust. For example, a process can get 
into the sleep state (interruptible sleep) due to a call to a syscall, no?

So maybe keep this sleep() as is?


More information about the ltp mailing list