I'm running Android-on-Linux, and communication of OpenGL ES calls over the QEMU pipe is very slow. QEMU pipes should be the fastest possible way to do this; could this be due to the repeated user/kernel mode transitions?


  1. How long do kernel=>user and user=>kernel mode transitions take on Linux? On Android?
  2. How many transitions are likely to occur for say, rendering a real-time graphics game?
  • 1
    Depends on if you're referring to a context switch, or a mode switch. Mode switching is cheap, context switching not so much, but unless you hammer it to death, shouldn't be causing problems. Here's a really nice article on the subject: blog.tsunanet.net/2010/11/…
    – phemmer
    Feb 14, 2014 at 4:26

1 Answer 1


That depends quite a bit on the exact kernel (the exact mechanism used has changed, and might even depend on configuration), and (obviously) on the exact processor. All that can be said with some confidence is that the kernel developers do their utmost to make this as fast as possible (after all, this is something that millions of systems do tens of times a second).

  • I am using an Intel Atom processor without EPT, which I suspect is causing a lot of overhead. Feb 15, 2014 at 0:23
  • " Suspect" isn't enough. You must measure this somehow. There are benchmarks for low-level system performance, can't look them up right now due to flaky net.
    – vonbrand
    Feb 18, 2014 at 0:54
  • Could you look them up? There are many, many benchmarks I could run, which is why I'm trying to evaluate likely/unlikely overheads, and reduce the number of benchmarks to try. Feb 22, 2014 at 0:24
  • 1
    As I said, my network is flaky. But search for the Benchmarking-HOWTO on tldp.org. Probably quite old, but still useful.
    – vonbrand
    Feb 22, 2014 at 15:02
  • 1
    At work with decent network now. Take a peek at lmbench, or it's latest alpha. Dated, but it is a set of portable low-level benchmarks for stuff like the cost of system calls.
    – vonbrand
    Feb 24, 2014 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .