Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Kernel to user space communication

501 views
Skip to first unread message

victor

unread,
Sep 3, 2014, 6:47:09 AM9/3/14
to
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.

Rainer Weikusat

unread,
Sep 3, 2014, 9:50:05 AM9/3/14
to
System call arguments and socket options would be two additional ones.

Karthik Balaguru

unread,
Sep 21, 2014, 12:42:15 PM9/21/14
to
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

Karthik Balaguru

unread,
Sep 21, 2014, 1:43:40 PM9/21/14
to
Also, the performance measurement can be done with performance counters. Normally it depends on the processor support too. Accordingly, the performance counters can be observed in cat /proc/ directory with corresponding name.

Karthik
0 new messages