Hi Dave,

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.

   1416      1   3  db506ac0  IN  36235.9     936 4194128  debuggerd
   1417      1   3  db500040  IN   0.0   16512     36  rild
   1418      1   1  db500580  IN   0.1   47160    488  surfaceflinger
   1419      1   0  db74d040  IN   1.1  458544   5148  zygote
   1420      1   1  db5d3ac0  IN  36235.9   13868 4194280  drmserver
   1421      1   1  db5d3580  IN   0.0   54944     20  mediaserver
   1422      1   0  db7c9580  IN   0.0     900     20  installd
   1423      1   0  db7c9040  IN  36235.8    1828 4194112  keystore
   1424      1   3  db5d8580  IN  36235.9    1152 4194276  akmdfs
   1426      1   3  db7bd040  IN  36235.9   10880 4194212  glgps
   1428      1   0  db61c040  IN  36235.9    2084 4194152  usb_portd
   1429      1   0  db753ac0  IN  36235.9     868 4194148  atxd_proxy
   1431      1   1  da6fbac0  UN  36235.9    6100 4194280  bkmgrd


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.
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.

Please share your thoughts on this.

Thanks,
Vinayak