LWN.net Logo

POSIX_FADV_VOLATILE and Android

POSIX_FADV_VOLATILE and Android

Posted Nov 27, 2011 0:21 UTC (Sun) by jhhaller (subscriber, #56103)
Parent article: POSIX_FADV_VOLATILE

The statement that Android needs to support an older mechanism for some time is too strong, as an Android version generally is an association between a user and a kernel. It's quite unusual to upgrade the kernel without updating the userland (although the opposite isn't necessarily true). Adding a configuration to the userland build to match it to the kernel should be sufficient to allow a flag day change.


(Log in to post comments)

You forgot about NDK

Posted Nov 27, 2011 0:58 UTC (Sun) by khim (subscriber, #9252) [Link]

Close, but no cigar. If you think only about Dalvik, then yes, everything can be emulated. But NDK programs can (and do) use ashmem directly. This means it must be supported for long, long time. No flag day for you :-)

You forgot about NDK

Posted Nov 27, 2011 10:16 UTC (Sun) by jhhaller (subscriber, #56103) [Link]

If NDK applications were staticly linked with libcutils and libc, then yes, they won't work. The shared libraries could be changed to emulate the previous behavior, but, admittedly, that's starting to get a bit extreme to change open and ioctl to strip off the ashmem operations and emulate them.

Changing the ashmem_* API implementation would be the most straightforward, and would address most applications. Those not using the ashmem_* APIs, or using a static library version of libcutils, deserve what they get, particularly taking heed of the NDK warning about which APIs are stable. If an application uses a static library, they should set the maxSdkVersion attribute, as they are likely to get broken in some future release. But, the ashmem APIs will need to be available essentially forever in the library, although the ashmem header file could be removed in future NDK releases, assuming the new service was implemented in the kernel. The user/kernel dependencies are still somewhat nebulous. While ICS devices are generally built with a 3.0 kernel, the emulator still runs under 2.6.39, so the flag day might still take an additional platform release, or the ashwin implementation would need to know the capability of the kernel. The Android ROM hacker community is generally still working with 2.6.36 kernels, particularly for non-OMAP devices.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds