Re: [LTP] [PATCH 2/2] mm/lib: increase sleep time in ksm scanning

Wanlong Gao
2012-07-09T13:40:50Z

On 07/09/2012 08:37 PM, Caspar Zhang wrote:
> On 07/09/2012 07:32 PM, Wanlong Gao wrote:
>> On 07/09/2012 05:51 PM, Caspar Zhang wrote:
>>>
>>> for some systems under pressure, we've observed that sleeping 5 seconds
>>> is not sufficient for completing ksm scanning, to fix this, we should
>>> give ksmd more time to scan the mergable pages by increasing sleeping
>>> time to 10s.
>>
>> If 5s is not enough, isn't we waiting here already?
>
> Sorry, I'm not catching you... :-( the problem currently we encounter is that if 5s given, all ksm values (pages_sharing, pages_shared, etc) might remain the same between before and after sleeping, so the wait_ksmd function could exit. But in fact the kernel could be busy under pressure and it just needs more than 5s to merge the same page. Using 10s as polling interval can make sure if ksm values remains the same between each loop, it should indicates that ksmd has done scanning correctly.
>

Oops, it's a serious problem, so can we first wait for changing and then wait for not changing?
I'm afraid that hard coded sleep time can't do the right thing on some systems.

Thanks,
Wanlong Gao

> Thanks,
> Caspar