Take the 2-minute tour ×
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.

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?

Specifically:

  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
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/… –  Patrick Feb 14 at 4:26
add comment

1 Answer

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 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 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 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 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 at 16:31
add comment

Your Answer

 
discard

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.