On Mon, Jun 04, 2007 at 10:05:35AM +0200, Jens Axboe wrote:
> On Mon, Jun 04 2007, Fengguang Wu wrote:
> > Hi Jens,
> >
> > This is another try, still not in a comfortable state though.
> > //Busy waiting is possible for interleaved reads.
>
> A few random comments...
>
> Adding an internal flag
On Mon, Jun 04 2007, Fengguang Wu wrote:
> Hi Jens,
>
> This is another try, still not in a comfortable state though.
> //Busy waiting is possible for interleaved reads.
A few random comments...
Adding an internal flag is fine, but please put it at the upper end of
the spectrum. So, use (1 << 31
Hi Jens,
This is another try, still not in a comfortable state though.
//Busy waiting is possible for interleaved reads.
Fengguang
---
In non-block splicing read, return EAGAIN once for possible I/O waits.
It avoids busy waiting by checking (ra.prev_index != index) in
__generic_file_splice_read
On Sun, Jun 03, 2007 at 09:05:08PM +0800, Fengguang Wu wrote:
> In non-block splicing, return EAGAIN once for all possible I/O waits.
>
> It works by checking (ra.prev_index != index) in
> __generic_file_splice_read(). Another reader on the same fd will at
> worst cause a few more splice syscalls
On Sat, Jun 02, 2007 at 08:40:04AM -0700, Linus Torvalds wrote:
> On Sat, 2 Jun 2007, Jens Axboe wrote:
> Your suggested:
>
> > if ((flags & SPLICE_F_NONBLOCK) && spd.nr_pages) {
> > if (TestSetPageLocked(page))
> > break;
> > } else
> >
On Sat, Jun 02 2007, Linus Torvalds wrote:
>
>
> On Sat, 2 Jun 2007, Jens Axboe wrote:
> >
> > splice() WILL return EAGAIN, but in that case it should have triggered
> > the read-ahead and thus started some IO.
>
> That's not enough.
>
> If the IO has already been started, splice needs to wait.
On Sat, 2 Jun 2007, Jens Axboe wrote:
>
> splice() WILL return EAGAIN, but in that case it should have triggered
> the read-ahead and thus started some IO.
That's not enough.
If the IO has already been started, splice needs to wait.
> For the from-file case, see __generic_file_splice_read(). s
On Fri, Jun 01 2007, H. Peter Anvin wrote:
> > So there's a few things to take away from this:
> >
> > - regular file access MUST NOT return EAGAIN just because a page isn't
> >in the cache. Doing so is simply a bug. No ifs, buts or maybe's about
> >it!
> >
> >Busy-looping is NOT A
On Fri, Jun 01 2007, Linus Torvalds wrote:
>
>
> On Fri, 1 Jun 2007, H. Peter Anvin wrote:
> >
> > Fair enough. Unix has traditionally not acknowledged the possibility of
> > nonblocking I/O on conventional files, for some odd reason.
>
> It's not odd at all.
>
> If you return EAGAIN, you had
Linus Torvalds wrote:
> And the thing is, neither poll nor select work on regular files. And no,
> that is _not_ just an implementation issue. It's very fundamental: neither
> poll nor select get the file offset to wait for!
>
> And that file offset is _critical_ for a regular file, in a way it
Linus Torvalds a écrit :
On Fri, 1 Jun 2007, H. Peter Anvin wrote:
Fair enough. Unix has traditionally not acknowledged the possibility of
nonblocking I/O on conventional files, for some odd reason.
It's not odd at all.
If you return EAGAIN, you had better have a way to _wait_ for that EAGA
H. Peter Anvin wrote:
> Eric Dumazet wrote:
>> As I said, this new non blocking feature on the input side (disk), is
>> nice and usefull. (For people scared by splice() syscall :) )
>>
>> Just have to mention it is a change of behavior, and documentation
>> probably needs to reflect this change. "S
On Fri, 1 Jun 2007, H. Peter Anvin wrote:
>
> Fair enough. Unix has traditionally not acknowledged the possibility of
> nonblocking I/O on conventional files, for some odd reason.
It's not odd at all.
If you return EAGAIN, you had better have a way to _wait_ for that EAGAIN
to go away, other
Eric Dumazet wrote:
>
> As I said, this new non blocking feature on the input side (disk), is
> nice and usefull. (For people scared by splice() syscall :) )
>
> Just have to mention it is a change of behavior, and documentation
> probably needs to reflect this change. "Since linux 2.6.23, sendfi
On Thu, May 31 2007, Jens Axboe wrote:
> > This change is wrong. loop or any existing user of ->sendfile absolutely
> > needs to go through a file operations vector so that file-system specific
> > actions such as locking are performed. This is required at least for the
> > clustered filesystems
On Fri, Jun 01 2007, Jens Axboe wrote:
> On Fri, Jun 01 2007, Neil Brown wrote:
> >
> > Ok, here is a patch that makes nfsd use splice instead of sendfile.
> > It appears to both compile and work.
> >
> > Some observations:
> > - __splice_from_pipe wants a "struct file*" and I wanted to pass a
H. Peter Anvin a écrit :
Jens Axboe wrote:
I would personally argue that sendfile() blocking on an O_NONBLOCK
desriptor, as opposed to returning EAGAIN, is a bug, and a fairly
serious such.
I agree, but it's still a change in behaviour. Even if we consider the
app buggy (it is), can we potentia
Jens Axboe wrote:
>>>
>> I would personally argue that sendfile() blocking on an O_NONBLOCK
>> desriptor, as opposed to returning EAGAIN, is a bug, and a fairly
>> serious such.
>
> I agree, but it's still a change in behaviour. Even if we consider the
> app buggy (it is), can we potentially break
On Fri, Jun 01 2007, Neil Brown wrote:
>
> Ok, here is a patch that makes nfsd use splice instead of sendfile.
> It appears to both compile and work.
>
> Some observations:
> - __splice_from_pipe wants a "struct file*" and I wanted to pass a
> "struct svcrqst *". Maybe it should take a voi
On Thu, May 31 2007, H. Peter Anvin wrote:
> Jens Axboe wrote:
> >>
> >>> - retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor,
> >>> out_file);
> >>> + fl = 0;
> >>> + if (in_file->f_flags & O_NONBLOCK)
> >>> + fl = SPLICE_F_NONBLOCK;
> >>> +
> >>> + retval = do_spl
Jens Axboe wrote:
>>
>>> - retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor,
>>> out_file);
>>> + fl = 0;
>>> + if (in_file->f_flags & O_NONBLOCK)
>>> + fl = SPLICE_F_NONBLOCK;
>>> +
>>> + retval = do_splice_direct(in_file, ppos, out_file, count, fl);
>>
Ok, here is a patch that makes nfsd use splice instead of sendfile.
It appears to both compile and work.
Some observations:
- __splice_from_pipe wants a "struct file*" and I wanted to pass a
"struct svcrqst *". Maybe it should take a void * ?
- It also wants a *ppos which I had no use fo
On Thu, May 31 2007, Hugh Dickins wrote:
> On Thu, 31 May 2007, Jens Axboe wrote:
> >
> > This patch removes the ->sendfile() hook from the file_operations
> > structure, and replaces the sys_sendfile() mechanism to be based on
> > ->splice_read() instead. There should be no functional changes.
>
On Thu, May 31 2007, Tom Zanussi wrote:
> On Thu, 2007-05-31 at 12:33 +0200, Jens Axboe wrote:
> > Hi,
> >
> > This patch removes the ->sendfile() hook from the file_operations
> > structure, and replaces the sys_sendfile() mechanism to be based on
> > ->splice_read() instead. There should be no f
On Thu, May 31, 2007 at 06:06:19PM +0100, Hugh Dickins wrote:
> Christoph already picked up on that, and it's of interest to shmem too:
> loop over tmpfs in 2.6 was relying on shmem_file_sendfile, for which
> the generic route is not good enough.
>
> If we're giving a .splice_read to everything wh
On Thu, 31 May 2007, Jens Axboe wrote:
>
> This patch removes the ->sendfile() hook from the file_operations
> structure, and replaces the sys_sendfile() mechanism to be based on
> ->splice_read() instead. There should be no functional changes.
>
> Work to be done:
>
> - The ext2 xip support nee
On Thu, 2007-05-31 at 12:33 +0200, Jens Axboe wrote:
> Hi,
>
> This patch removes the ->sendfile() hook from the file_operations
> structure, and replaces the sys_sendfile() mechanism to be based on
> ->splice_read() instead. There should be no functional changes.
>
> Work to be done:
>
> - The
On Thu, May 31 2007, Neil Brown wrote:
> On Thursday May 31, [EMAIL PROTECTED] wrote:
> > On Thu, May 31 2007, Christoph Hellwig wrote:
> > > On Thu, May 31, 2007 at 12:33:16PM +0200, Jens Axboe wrote:
> > > > - nfds: The ->rq_sendfile_ok optimization is gone for now. I can't
> > > > determine th
On Thursday May 31, [EMAIL PROTECTED] wrote:
> On Thu, May 31 2007, Christoph Hellwig wrote:
> > On Thu, May 31, 2007 at 12:33:16PM +0200, Jens Axboe wrote:
> > > - nfds: The ->rq_sendfile_ok optimization is gone for now. I can't
> > > determine the value of it, but I'm assuming it's there for a
On Thu, May 31 2007, Christoph Hellwig wrote:
> On Thu, May 31, 2007 at 12:33:16PM +0200, Jens Axboe wrote:
> > - nfds: The ->rq_sendfile_ok optimization is gone for now. I can't
> > determine the value of it, but I'm assuming it's there for a reason.
> > Any chance this can be converted to spl
On Thu, May 31 2007, Carsten Otte wrote:
> Jens Axboe wrote:
> >Work to be done:
> >
> >- The ext2 xip support needs a splice_read() implementation, currently I
> > just if 0'ed out the send xip_file_sendfile(). CC'ed Carsten, who
> > seems to be the author of this code.
> Yup. Will do the splice
Jens Axboe wrote:
Work to be done:
- The ext2 xip support needs a splice_read() implementation, currently I
just if 0'ed out the send xip_file_sendfile(). CC'ed Carsten, who
seems to be the author of this code.
Yup. Will do the splice_read implementation for xip. Do you want to
see it in sp
On Thu, May 31, 2007 at 12:33:16PM +0200, Jens Axboe wrote:
> - nfds: The ->rq_sendfile_ok optimization is gone for now. I can't
> determine the value of it, but I'm assuming it's there for a reason.
> Any chance this can be converted to splice, or use something else than
> ->sendfile()? CC'e
On Thu, May 31 2007, Eric Dumazet wrote:
> On Thu, 31 May 2007 12:33:16 +0200
> Jens Axboe <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > This patch removes the ->sendfile() hook from the file_operations
> > structure, and replaces the sys_sendfile() mechanism to be based on
> > ->splice_read() ins
On Thu, May 31 2007, Jens Axboe wrote:
> Hi,
>
> This patch removes the ->sendfile() hook from the file_operations
> structure, and replaces the sys_sendfile() mechanism to be based on
> ->splice_read() instead. There should be no functional changes.
Forgot to mention, that the modified kernel of
On Thu, 31 May 2007 12:33:16 +0200
Jens Axboe <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This patch removes the ->sendfile() hook from the file_operations
> structure, and replaces the sys_sendfile() mechanism to be based on
> ->splice_read() instead. There should be no functional changes.
>
> -
Hi,
This patch removes the ->sendfile() hook from the file_operations
structure, and replaces the sys_sendfile() mechanism to be based on
->splice_read() instead. There should be no functional changes.
Work to be done:
- The ext2 xip support needs a splice_read() implementation, currently I
ju
37 matches
Mail list logo