Optimizing linux applications with the help of the kernel.
PATCH 1/1 Optimizing linux applications with the help of the kernel.
Hi All,
I just had an idea for improving the performance of linux applications with some help from the kernel. Let's say that I have to make a copy of a file. So, I read the input file into a buffer and then write the buffer to the output file.
In both these cases the same data is coming from kernel_to_user and then from user_to_kernel. If this can be short-circuited, that is, from kernel_to_kernel then the performance can be increased a lot.
The psuedocode would be:
fd_inp = open _output_filefd_out = open _input_fileinstruct_kernel to write next data read from fd_inp to fd_out read fd_out
The same mechanism can be applied to many other scenarios.
May be whatever I am thinking is wrong or involves lot of complexities but this is just a thought.
Regards,
Amit
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
Quoted 3 lines · Amit Choudhary
In both these cases the same data is coming from
kernel_to_userand then fromuser_to_kernel. If this can be short-circuited, that is, fromkernel_to_kernelthen the performance can be increased a lot.
Google on 'splice linux'. It can't do what you want right now exactly, but it might.
Signature · 2 lines
http://www.PowerDNS.com Open source, database driven DNS Software http://netherlabs.nl Open and Closed source services
Quoted 10 lines · Amit Choudhary
Hi All,
I just had an idea for improving the performance of linux applications with some help from the kernel. Let's say that I have to make a copy of a file. So, I read the input file into a buffer and then write the buffer to the output file.
In both these cases the same data is coming from
kernel_to_userand then fromuser_to_kernel. If this can be short-circuited, that is, fromkernel_to_kernelthen the performance can be increased a lot.
Quoted 8 lines
The psuedocode would be:
fd_inp= open_output_filefd_out= open_input_fileinstruct_kernelto write next data read fromfd_inptofd_outreadfd_out
I think you are describing the splice syscall:
see http://lwn.net/Articles/178199/
regards,
Benoit
Quoted 10 lines · Amit Choudhary
Hi All,
I just had an idea for improving the performance of linux applications with some help from the kernel. Let's say that I have to make a copy of a file. So, I read the input file into a buffer and then write the buffer to the output file.
In both these cases the same data is coming from
kernel_to_userand then fromuser_to_kernel. If this can be short-circuited, that is, fromkernel_to_kernelthen the performance can be increased a lot.
See the linux specific splice() syscall - "man 2 splice".
Signature · 3 lines
Jesper Juhl <[email protected]> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html