[CRIU] About ashmem and Deleted Pages

Pavel Emelyanov xemul at virtuozzo.com
Wed Apr 6 05:10:37 PDT 2016


On 04/05/2016 09:40 PM, Christopher Covington wrote:
> On 03/30/2016 06:08 AM, Pavel Emelyanov wrote:
>> On 03/30/2016 11:16 AM, Abdullah Yousafzai wrote:
>>> Sorry for a bit late reply, Please find the attachment
>>
>> OK, so the "bogus" mapping is
>>
>> 12c00000-12e01000 r--p 00000000 00:05 5475                               /dev/ashmem/dalvik-main space (deleted)
>>
>> It's been detected as such because
>>
>> a) it's private (the 'p' letter in the 2nd column)
>> b) it's detected and MAP_SHARED | MAP_ANON (criu created the MAP_SHARED | MAP_ANON mapping
>>    and found 00:05 device in the 4th column)
>>
>> So in order to fix this we need a way to distinguish the anonymouns shared
>> memory from dalvik ashmem. Can you help with it, because none of us has
>> kernel experience with android?
> 
> Possibilities that come to mind for me are string matching "/dev/ashmem"
> and/or trying one of the ashmem-specific IOCTLs like ASHMEM_GET_NAME.

Yes, that's how to detect and work with ashmem itself, but how to
distinghuish plain mmap(MAP_ANON|MAP_SHARED) mapping from this? From
what I've seen from logs plan anon shared mappings are somehow linked
to ashmem.

> I don't have real personal experience with ashmem, but based the above
> on some quick reading, links below for anyone who might want to do the same.
> 
> http://elinux.org/Android_Kernel_Features#ashmem
> 
> http://stackoverflow.com/questions/9970858/what-special-powers-does-ashmem-have
> 
> http://notjustburritos.tumblr.com/post/21442138796/an-introduction-to-android-shared-memory
> 
> http://thread.gmane.org/gmane.linux.kernel/1168763
> 
> http://lxr.free-electrons.com/source/drivers/staging/android/ashmem.c
> 
> Cheers,
> Cov
> 



More information about the CRIU mailing list