<div dir="ltr">Hi Dave,<br><br>It was noticed that when SPLIT_RSS_ACCOUNTING is enabled in kernel, the RSS values shown by ps command is huge (negative value represented as ulong) for certain tasks. Shown below is a ps output of such kind.<br>
<br> 1416 1 3 db506ac0 IN 36235.9 936 4194128 debuggerd<br> 1417 1 3 db500040 IN 0.0 16512 36 rild<br> 1418 1 1 db500580 IN 0.1 47160 488 surfaceflinger<br> 1419 1 0 db74d040 IN 1.1 458544 5148 zygote<br>
<b> 1420 1 1 db5d3ac0 IN 36235.9 13868 4194280 drmserver</b><br> 1421 1 1 db5d3580 IN 0.0 54944 20 mediaserver<br> 1422 1 0 db7c9580 IN 0.0 900 20 installd<br> <b> 1423 1 0 db7c9040 IN 36235.8 1828 4194112 keystore<br>
1424 1 3 db5d8580 IN 36235.9 1152 4194276 akmdfs<br> 1426 1 3 db7bd040 IN 36235.9 10880 4194212 glgps<br> 1428 1 0 db61c040 IN 36235.9 2084 4194152 usb_portd<br> 1429 1 0 db753ac0 IN 36235.9 868 4194148 atxd_proxy<br>
1431 1 1 da6fbac0 UN 36235.9 6100 4194280 bkmgrd</b><br><div><b><br></b></div><div>When SPLIT_RSS_ACCOUNTING is enabled, the rss values are stored in task_struct of each thread, and is synced to the mm_struct.rss_stat only at certain events. So during a crash it is likely that mm.rss_stat contains old values which can even be negative.</div>
<div>I have prepared a patch (attached) to sync the task_struct.rss_stat with mm.rss_stat, in get_task_mem_usage, when SPLIT_RSS_ACCOUNTING is enabled.</div><div><br></div><div>Please share your thoughts on this.</div><div>
<br></div><div>Thanks,</div><div>Vinayak</div></div>