Harman
Harman

Reputation: 1581

Large Data Flow between User and Kernel

What is the best way(performance) to have a bi-directional data flow between user-level and kernel-level ?

I understand that you can open a NETLINK socket and transfer the data through there. But, we have to adopt some other user-kernel interaction(system calls, ioctl) for sending control information across. Is this the most efficient way to transfer large amount of data across user-kernel boundary ?

Upvotes: 4

Views: 1438

Answers (1)

Martin James
Martin James

Reputation: 24847

Passing large buffers of data into the kernel driver/thread/whatever is no problem - the kernel has the privilege to read it, no problem. For returning stuff, the ususal way is to provide the kernel thingy with a sufficiently large user-space buffer, or buffer pool, for it to return data in. That's how its done for the usual stuff - file/network read/write, for example.

What is the problem, more exactly - do you need to transfer the data to/from kernel level on a different machine?

Rgds, Martin

Upvotes: 4

Related Questions