f



Kernel to user space communication

Hi,
  Is anyone aware of any performance measurements for kernel to user space data access? The techniques i can think of are netlink sockets, mmap to a dev and ioctl. But i could not find any pointers on which one to use. 

Regards.
0
victor
9/3/2014 10:47:09 AM
comp.os.linux.development.apps 5216 articles. 1 followers. Post Follow

3 Replies
714 Views

Similar Articles

[PageSpeed] 37

victor <ramkumar2579@gmail.com> writes:
>   Is anyone aware of any performance measurements for kernel to user
>   space data access? The techniques i can think of are netlink
>   sockets, mmap to a dev and ioctl. But i could not find any pointers
>   on which one to use.

System call arguments and socket options would be two additional ones.
0
Rainer
9/3/2014 1:50:05 PM
On Wednesday, 3 September 2014 16:17:09 UTC+5:30, victor  wrote:
> Hi,
>=20
>   Is anyone aware of any performance measurements for kernel to user spac=
e data access? The techniques i can think of are netlink sockets, mmap to a=
 dev and ioctl. But i could not find any pointers on which one to use.=20
>=20
>=20

Here are few high level inputs for your consideration :

mmap is the does transferring data between user space and kernel space with=
out explicit copying. The challenge here is in the kernel module in case of=
 virtual memory(memory management unit) based systems.

ioctl uses copy to user and copy from user mechanisms. Also, asynchronous m=
essages cannot be sent to user space to kernel space incase of ioctl.
ioctl will be very useful in collection of information/statistics
The challenge here is that extending ioctl function by addition of new para=
meters that result in the change in the structure layout that can cause bac=
kward compatibility issues.


netlink does not use any system calls and it is based on standard socket AP=
Is.We can send asynchronous messages from user space to kernel space. Here,=
 the challenge is reliable transmissions from kernel to user are impossible=
 in any case. i.e, as per the manpage, the kernel can't send a netlink mess=
age if the socket buffer is full: the message will be dropped and the kerne=
l and the user-space process will no longer have the same view of kernel st=
ate. It is up to the application to detect when this happens.

Karthik
0
Karthik
9/21/2014 4:42:15 PM
On Sunday, 21 September 2014 22:12:15 UTC+5:30, Karthik Balaguru  wrote:
> On Wednesday, 3 September 2014 16:17:09 UTC+5:30, victor  wrote:
>=20
> > Hi,
>=20
> >=20
>=20
> >   Is anyone aware of any performance measurements for kernel to user sp=
ace data access? The techniques i can think of are netlink sockets, mmap to=
 a dev and ioctl. But i could not find any pointers on which one to use.=20
>=20
> >=20
>=20
> >=20
>=20
>=20
>=20
> Here are few high level inputs for your consideration :
>=20
>=20
>=20
> mmap is the does transferring data between user space and kernel space wi=
thout explicit copying. The challenge here is in the kernel module in case =
of virtual memory(memory management unit) based systems.
>=20
>=20
>=20
> ioctl uses copy to user and copy from user mechanisms. Also, asynchronous=
 messages cannot be sent to user space to kernel space incase of ioctl.
>=20
> ioctl will be very useful in collection of information/statistics
>=20
> The challenge here is that extending ioctl function by addition of new pa=
rameters that result in the change in the structure layout that can cause b=
ackward compatibility issues.
>=20
>=20
>=20
>=20
>=20
> netlink does not use any system calls and it is based on standard socket =
APIs.We can send asynchronous messages from user space to kernel space. Her=
e, the challenge is reliable transmissions from kernel to user are impossib=
le in any case. i.e, as per the manpage, the kernel can't send a netlink me=
ssage if the socket buffer is full: the message will be dropped and the ker=
nel and the user-space process will no longer have the same view of kernel =
state. It is up to the application to detect when this happens.
>=20
>=20

Also, the performance measurement can be done with performance counters. No=
rmally it depends on the processor support too. Accordingly, the performanc=
e counters can be observed in cat /proc/ directory with corresponding name.

Karthik
0
Karthik
9/21/2014 5:43:40 PM
Reply:

Similar Artilces:

Communicating Data from User Space to Kernel Space
struct rule{ int proto; char source[15]; }instance; I have written this structure into a file in user space ,say rule.txt . Say this file contains 10 records , i. e 10 instances of the above structure.Now I would like to read the same file in kernel space by a kernel module by reading 1 record at a time. How can i do this ? Is there any other way to do this without using files ? My objective is to read the 10 records from kernel space one record at a time and not the individual bytes. amit wrote: > > Is there any other way to do this without...

Synchronizing user space threads with kernel space in linux
I want to synchronize a user space thread to an external event that generates an interrupt. I thought of using the following approach: the ISR that treats the interrupt does a quick processing (such as data capture and buffering) and then sends data to the user space thread through a message queue or signals to the thread waiting on a semaphore and it gets the buffered data from shared memory or some similar mechanism. So far I haven't succeded in finding a way to do it. I've tryed to write a module which uses semaphores (<linux/sem.h>) but aparently there is no way to use SysV I...

Kernel Space to User Space Communication in 2.6
To pass data from kernel space to user space we can use netlink sockets. Is there a better or efficient mechanism than netlink in 2.6?? Please advice. Thanks /R -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ramesh wrote: > To pass data from kernel space to user space we can use netlink > sockets. Is there a better or efficient mechanism than netlink in > 2.6?? Please advice. As far as I'm concerned, the best way to pass data from kernelspace to userspace is through the use of the userspace read(2) syscall. - -- Lew Pitcher Master Codewright & JOAT-in-...

are user space app clusters the future of computing? start with say freebsd then load haskell then app from user space establishes cluster membership and prvides user environemnt like plan9 from b
are user space app clusters the future of computing? start with say freebsd then load haskell then app from user space establishes cluster membership and prvides user environemnt like plan9 from bell labs? ...

sock_register only available in kernel space or also in user space ? If only kernel space is there something equivalent ?
Hello, is sock_register only available in kernel space or can it be also used in user space to register a new socket ? If only kernel space, is there a equivalent function for doing this ? Or some kind of wrapper, so a user mode application can register a new socket via kernel ? Regards, Martin "Maurer Martin (CN MUC)" wrote: > > Hello, > > is sock_register only available in kernel space or can it be also used in > user space It can be used only in kernel mode. > to register a new socket ? That is not what it does accordin...

linux kernel user space
I am developing a kernel module, and as to prevent a page fault from occuring when accessing data from user space, I need to copy it to kernel space. Or so I thought. Until I was told that the linux kernel is in user space, so doing that is unneeded and all that I need to do is just use access_ok() on the address before using the data to which the pointer points to. Is this correct? If not, how should I handle user space addresses? Also, I have heard that the syscall table can no longer be modified in 2.5? What is the validity of that? -- nethlek Mantorok Redgormor wrote: &g...

communicating with user space from the kernel
I'm attempting to write a kernel module that will call a user space function. The user space function will return a pointer to a user space memory location. I'm thinking that the way to do this is with the BSD socket interface, but I'm inexperieced with sockets. Am I on the right track or is there an easier way to do this? ...

os.linux.development.apps
hEy, Please Visit http://www.familypk.com Familypk About Articles, Tutorials, Learning, Block checkers, Myspace, Twist, Daily news updates, Entertainment, Horoscopes, Movies, Stories, Kids, Woman, Kitchen, Islamic names, Hair style, Fashion, Home decoration, Songs, PTCL, Games, etc..... Please Visit http://www.enttwist.com Enttwist About Articles, Tutorials, Cheat Codes, Hacking News, Games Setup, Greeting Cards, E-Cards, Telephone Directry, Web Directry, Learning, Block checkers, Myspace, Twist, Daily news updates, Entertainment, Horoscopes, Movies, ...

sending user defined signals from kernel space to user space
Hi all The linux version we are using is 2.4.We have requirement of running a state machine in kernel space .There are four states in the state machine namely. STATE_1,STATE_2, STATE_3 and STATE_4. We have requirement of sending four asynchronous notifications from kernel space to user space for each state change in the state machine. I am able to send two signals namely SIGUSR1 and SIGUSR2 from kernel space to user space for states STATE_1 and STATE_2 respectively. Can any one help me how can I send two more user defined signals from kernel space to user space for STATE_3 and STA...

sending user defined signals from kernel space to user space
Hi all The linux version we are using is 2.4.We have requirement of running a state machine in kernel space .There are four states in the state machine namely. STATE_1,STATE_2, STATE_3 and STATE_4. We have requirement of sending four asynchronous notifications from kernel space to user space for each state change in the state machine. I am able to send two signals namely SIGUSR1 and SIGUSR2 from kernel space to user space for states STATE_1 and STATE_2 respectively. Can any one help me how can I send two more user defined signals from kernel space to user space for STATE_3 and STA...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the o...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the other ker...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the other ker...

Linux Kernel Developer Offers 'Free Linux Driver Development'
"Yes, that's right, the Linux kernel community is offering all companies free Linux driver development. No longer do you have to suffer through all of the different examples in the Linux Device Driver Kit, or pick through the thousands ... <http://www.osnews.com/story.php?news_id=17109> -- ..................... http://www.vanwensveen.nl/rants/microsoft/IhateMS.html ...

Web resources about - Kernel to user space communication - comp.os.linux.development.apps

Communication - Wikipedia, the free encyclopedia
) is the activity of conveying information through the exchange of ideas, feelings, intentions, attitudes, expectations, perceptions or commands, ...

VoIP Business, VoIP Technology, VoIP Security - Fierce Enterprise Communications
Visit FierceVoIP for the latest updates in VoIP business, unified communications, VoIP technology, mobile VoIP, VoIP security and more VoIP news. ...

Mobile News Online - The UK's leading mobile communication industry news site
This month, thousands of students will be starting university for the first time. Some will need new phones. Mystery Caller is on the case to ...

NFL's LA Rams lust after GoPro Director of Communications Lara M Sasken's Twitter handle
How much is a Twitter name worth? A considerable amount, it would seem.

Communications Minister Mitch Fifield dubs TV licence fees 'super profits tax'
Communications Minister Mitch Fifield has indicated the television industry's $153 million annual fees may no may longer be appropriate.

Rona Ambrose 'in communication' with Kevin O'Leary on leadership bid
Celebrity businessman Kevin O'Leary is having conversations with interim Conservative Leader Rona Ambrose, continuing his informal moves behind ...

Arthur Sadoun Reveals His Plan for Publicis Communications
... days, 100 senior executives from Publicis Groupe's creative networks have gathered in New York to hear Arthur Sadoun, the CEO of Publicis Communications, ...

Why Modern Communication is Broken: 3 numbers tell it all
... his days building a visual collaboration platform for high-performing teams. With this post I am diving further into troubles of modern communication, ...

QNX’s in-car communications may solve the turn-and-yell to backseat kids issue
Video shot/edited by Jennifer Hahn. (video link) LAS VEGAS—Several years ago, Blackberry bought QNX , a company known for its real-time automotive ...

ISIS has its own secure messaging system this illustrates the futility of communication surveillance
Moves by governments to monitor web-based communication with a view to thwarting terrorism is utterly, utterly futile. Just like the NSA's dragnet-style ...

Resources last updated: 1/26/2016 1:28:53 PM