Proc file vs Device file (performance comparision)
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Proc file vs Device file (performance comparision)
Hi,
I want to share the data from the kernel to a process and from a processs to kernel. At this time I have two choices
a) to create a /proc file from the kernel module and access it for reading and writting from the process.
b) to create a device file from the kernel module and access it for reading and writting from the process.
However, I am not sure, which will give me a better performance.
Do we get any advantage in using the one over the other?
It is a programming query.
Both these type of files can be used for sending data from process to kernel using the write or ioctl function.
In the similar way, process can read data from kernel by using write function which can be implemnted in kernel module for both of these file types.
My query is that is there any advantage in terms of performance in using /dev file type over /proc files.
Please re-read the previous post. Neither one is appropriate for what you are trying to do.
Read up on "named pipes" and "shared memory segments."
And... "let 'performance' b'dammed." In other words, " performance... who cares about 'performance.'" No matter what you do these days, it will 'perform.'
Please re-read the previous post. Neither one is appropriate for what you are trying to do.
Do you really think you understand what the OP is trying to do?
I thought it was an interesting question when I first saw this thread (would have answered if I knew the answer). I was annoyed (I expect not as much as the OP) each time someone else who didn't know the answer replied.
Hopefully the clutter in the thread (including my post) won't discourage someone who does know the answer from posting.
I want to share the data from the kernel to a process and from a processs to kernel. At this time I have two choices
a) to create a /proc file from the kernel module and access it for reading and writting from the process.
b) to create a device file from the kernel module and access it for reading and writting from the process.
However, I am not sure, which will give me a better performance.
The difference between /proc and /dev is more in how the files relate to the rest to kernel; if you have your own read/write/ioctl callbacks, the implementation is exactly the same, so there is no performance difference at all.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.