Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #756

Re: Kernel to user space communication

Newsgroups comp.os.linux.development.apps
Date 2014-09-21 09:42 -0700
References <9ffed644-90c1-4c53-9805-2d43a4f7a5b4@googlegroups.com>
Message-ID <312400e5-fea2-4d8b-9d96-c2559817dc89@googlegroups.com> (permalink)
Subject Re: Kernel to user space communication
From Karthik Balaguru <karthik.balaguru007@gmail.com>

Show all headers | View raw


On Wednesday, 3 September 2014 16:17:09 UTC+5:30, victor  wrote:
> 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. 
> 
> 

Here are few high level inputs for your consideration :

mmap is the does transferring data between user space and kernel space without 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 messages 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 parameters that result in the change in the structure layout that can cause backward compatibility issues.


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. 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 message if the socket buffer is full: the message will be dropped and the kernel 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.

Karthik

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Kernel to user space communication victor <ramkumar2579@gmail.com> - 2014-09-03 03:47 -0700
  Re: Kernel to user space communication Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2014-09-03 14:50 +0100
  Re: Kernel to user space communication Karthik Balaguru <karthik.balaguru007@gmail.com> - 2014-09-21 09:42 -0700
    Re: Kernel to user space communication Karthik Balaguru <karthik.balaguru007@gmail.com> - 2014-09-21 10:43 -0700

csiph-web