• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

hungys/binder-for-linux: An experimental project to port Android Binder IPC subs ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

hungys/binder-for-linux

开源软件地址(OpenSource Url):

https://github.com/hungys/binder-for-linux

开源编程语言(OpenSource Language):

C++ 64.8%

开源软件介绍(OpenSource Introduction):

binder-for-linux

binder-for-linux is an experimental project to evaluate the feasibility of porting Android Binder IPC subsystem to Ubuntu Linux.

Environment

  • Ubuntu 14.04.4 LTS
  • Linux Kernel 4.2.0-27
  • gcc 4.9.3

Codebase

  • Binder driver: mainline kernel 4.2.0-27-generic
  • Android Framework version: android-6.0.1_r46

Modifications

  • Make binder & ashmem driver dynamically loadable
    • Modified as a standard loadable kernel module
    • Use kallsyms and a shell script to generate symbol dependencies that are not exposed by kernel (e.g. get_vm_area)
  • Fix compatability issues after replacing Bionic C library with glibc
  • Fix compatibility issues of atomic library
    • Some are changed to use standard C++ atomic library (C++11 and gcc 4.9.3+ are required)
    • cutils/atomic.h is re-implemented with x86 atomic instructions
  • Dependencies to Android log daemon and SELinux library are removed
  • And other small fixes...

Get Started

To compile all from source,

$ ./project.sh makeall

Now you can install kernel modules (binder & ashmem) by,

$ ./project.sh insmod

Then run Service Manager in background,

$ sudo servicemanager/servicemanager &

We also prepared a benchmark program to perform correctness test and performance test,

$ sudo test/binderAddInts -n 100 -p 0   # correctness test with 100 iterations
$ sudo test/binderAddInts -n 10000 -p 4096   # performance test with 4K payload and 10000 iterations

Results

Performance Evaluation

We found an obvious fact that when the payload size is greater than 16K, the transmission latency grows much more rapidly compared with a small payload. After tracing more source code, we inferred that this may be due to the use of the single global lock. The Binder driver heavily uses a global lock to protect the critical sections, this may lead to low utilization in high concurrency situation. Also, during the driver initialization phase, the Binder driver created a bottom half – workqueue, to handle the release of system resource and buffer. During the benchmark with larger payload and higher iterations (e.g. 10000 per test), the workqueue need to handle the release request more frequently; however, the implementation of release function also need to acquire the global lock, which leads to much lower performance for real data transmission.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap