LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
LinkBack Search this Thread
Old 01-23-2011, 07:27 PM   #1
dbadhani
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Rep: Reputation: 0
Cost of user-kernel mode switch


Hi,

I am working on a high performance proxy service and in the process was trying to find out the cost incurred in "user -> kernel" mode or "kernel -> user" mode transitions. If the cost is not significant, I could the existing kernel stack else will have to work on a user mode driver.

Would appreciate if anyone has some insights, benchmarks for the same or can sugget a good way to benchmark this.

Thanks,
Dev
 
Old 01-25-2011, 12:04 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

Well I am not an expert in this but it seems that any literature you will find on this topic will state that user/kernel mode switch is costly. But it seems difficult to find benchmarks.
Anyway I answer you just to share with you this link: http://web.yl.is.s.u-tokyo.ac.jp/~tosh/kml/
I hope you'll find it useful.

Regards,

Oliv'
 
Old 01-26-2011, 11:40 PM   #3
dbadhani
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks Oliv. There is some latency associated with mode switch, though the consensus is that its not as expensive as it used to be.
I was trying to get an estimate on what the cost is, relative to actual processing.
I did some tests myself with a 2Ghz processor, a single mode switch seems to be taking 150 cycles, so looks like not that bad.
 
Old 01-27-2011, 01:21 AM   #4
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

yes that's not so much time... also it will depend on how many times your application will do some context switch
By the way, as I am curious, I have continued my search on the subject and found this page: http://blog.tsunanet.net/2010/11/how...e-context.html where you will find interesting benchmarks about context switch.

Regards,

Oliv'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Cost Of ATI Kernel Mode-Setting On Fedora 12 LXer Syndicated Linux News 0 11-25-2009 05:50 PM
How to identify processes running in user mode and kernel mode subha109 Linux - Kernel 1 10-21-2009 11:37 AM
how to use the buffer of user mode in kernel mode liqiuhua123 Programming 2 02-05-2009 09:54 PM
how to switch from kernel mode to user mode manas_sem Programming 3 01-23-2007 09:14 AM
Interface between user mode and kernel mode santosh_pn Linux - Software 1 06-17-2005 07:20 AM


All times are GMT -5. The time now is 11:36 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration