Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?
share|improve this question
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/… – Patrick Feb 14 '14 at 4:26

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

share|improve this answer
I am using an Intel Atom processor without EPT, which I suspect is causing a lot of overhead. – chronospoon Feb 15 '14 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 '14 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. – chronospoon Feb 22 '14 at 0:24
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 '14 at 15:02
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 '14 at 16:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.