* [PATCH] [DISCUSS] Optimizing linux applications with the help of the kernel.
@ 2006-12-10 10:06 Amit Choudhary
2006-12-10 10:20 ` bert hubert
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Amit Choudhary @ 2006-12-10 10:06 UTC (permalink / raw)
To: Linux 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_file
fd_out = open _input_file
instruct_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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] [DISCUSS] Optimizing linux applications with the help of the kernel.
2006-12-10 10:06 [PATCH] [DISCUSS] Optimizing linux applications with the help of the kernel Amit Choudhary
@ 2006-12-10 10:20 ` bert hubert
2006-12-10 11:10 ` Benoit Boissinot
2006-12-10 11:14 ` Jesper Juhl
2 siblings, 0 replies; 4+ messages in thread
From: bert hubert @ 2006-12-10 10:20 UTC (permalink / raw)
To: Amit Choudhary; +Cc: Linux Kernel
On Sun, Dec 10, 2006 at 02:06:49AM -0800, Amit Choudhary wrote:
> 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.
Google on 'splice linux'. It can't do what you want right now exactly, but
it might.
--
http://www.PowerDNS.com Open source, database driven DNS Software
http://netherlabs.nl Open and Closed source services
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [DISCUSS] Optimizing linux applications with the help of the kernel.
2006-12-10 10:06 [PATCH] [DISCUSS] Optimizing linux applications with the help of the kernel Amit Choudhary
2006-12-10 10:20 ` bert hubert
@ 2006-12-10 11:10 ` Benoit Boissinot
2006-12-10 11:14 ` Jesper Juhl
2 siblings, 0 replies; 4+ messages in thread
From: Benoit Boissinot @ 2006-12-10 11:10 UTC (permalink / raw)
To: Amit Choudhary; +Cc: Linux Kernel
On 12/10/06, Amit Choudhary <amit2030@yahoo.com> wrote:
> 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_file
> fd_out = open _input_file
> instruct_kernel to write next data read from fd_inp to fd_out
> read fd_out
>
>
I think you are describing the splice syscall:
see http://lwn.net/Articles/178199/
regards,
Benoit
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [DISCUSS] Optimizing linux applications with the help of the kernel.
2006-12-10 10:06 [PATCH] [DISCUSS] Optimizing linux applications with the help of the kernel Amit Choudhary
2006-12-10 10:20 ` bert hubert
2006-12-10 11:10 ` Benoit Boissinot
@ 2006-12-10 11:14 ` Jesper Juhl
2 siblings, 0 replies; 4+ messages in thread
From: Jesper Juhl @ 2006-12-10 11:14 UTC (permalink / raw)
To: Amit Choudhary; +Cc: Linux Kernel
On 10/12/06, Amit Choudhary <amit2030@yahoo.com> wrote:
> 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.
>
See the linux specific splice() syscall - "man 2 splice".
--
Jesper Juhl <jesper.juhl@gmail.com>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-12-10 11:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-10 10:06 [PATCH] [DISCUSS] Optimizing linux applications with the help of the kernel Amit Choudhary
2006-12-10 10:20 ` bert hubert
2006-12-10 11:10 ` Benoit Boissinot
2006-12-10 11:14 ` Jesper Juhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®