All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, torvalds@linux-foundation.org
Subject: Re: [rfc patch 3/4] splice: remove confirm from pipe_buf_operations
Date: Tue, 24 Jun 2008 13:19:13 +0200	[thread overview]
Message-ID: <20080624111913.GP20851@kernel.dk> (raw)
In-Reply-To: <E1KB4Id-0000un-PV@pomaz-ex.szeredi.hu>

On Tue, Jun 24 2008, Miklos Szeredi wrote:
> > > The 'confirm' operation was only used for splicing from page cache, to
> > > wait for read on a page to finish.  But generic_file_splice_read()
> > > already blocks on readahead reads, so it seems logical to block on the
> > > rare and slow single page reads too.
> > > 
> > > So wait for readpage to finish inside __generic_file_splice_read() and
> > > remove the 'confirm' method.
> > > 
> > > This also fixes short return counts when the filesystem (e.g. fuse)
> > > invalidates the page between insertation and removal.
> > 
> > One of the basic goals of splice is to allow the pipe buffer to only be
> > consisten when a consumer asks for it, otherwise the filling will always
> > be sync. There should be no blocking on reads in the splice-in path,
> > only on consumption for splice-out.
> 
> What you are ignoring (and I've mentioned in the changelog) is that it
> is *already* sync.  Look at the code: this starts I/O:
> 
> 		page_cache_sync_readahead(mapping, &in->f_ra, in,
> 				index, req_pages - spd.nr_pages);
> 
> And this waits for it to finish:
> 
> 		if (!PageUptodate(page)) {
> 			...
> 				lock_page(page);
> 
> The only way it will be async, is if there's no readahead.  But do we
> want to optmize that case?

It's an unfortunate side effect of the read-ahead, I'd much rather just
get rid of that. It _should_ behave like the non-ra case, when a page is
added it merely has IO started on it. So we want to have that be
something like

        if (!PageUptodate(page) && !PageInFlight(page))
                ...

basically like PageWriteback(), but for read-in.

-- 
Jens Axboe


WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <jens.axboe@oracle.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, torvalds@linux-foundation.org
Subject: Re: [rfc patch 3/4] splice: remove confirm from pipe_buf_operations
Date: Tue, 24 Jun 2008 13:19:13 +0200	[thread overview]
Message-ID: <20080624111913.GP20851@kernel.dk> (raw)
In-Reply-To: <E1KB4Id-0000un-PV@pomaz-ex.szeredi.hu>

On Tue, Jun 24 2008, Miklos Szeredi wrote:
> > > The 'confirm' operation was only used for splicing from page cache, to
> > > wait for read on a page to finish.  But generic_file_splice_read()
> > > already blocks on readahead reads, so it seems logical to block on the
> > > rare and slow single page reads too.
> > > 
> > > So wait for readpage to finish inside __generic_file_splice_read() and
> > > remove the 'confirm' method.
> > > 
> > > This also fixes short return counts when the filesystem (e.g. fuse)
> > > invalidates the page between insertation and removal.
> > 
> > One of the basic goals of splice is to allow the pipe buffer to only be
> > consisten when a consumer asks for it, otherwise the filling will always
> > be sync. There should be no blocking on reads in the splice-in path,
> > only on consumption for splice-out.
> 
> What you are ignoring (and I've mentioned in the changelog) is that it
> is *already* sync.  Look at the code: this starts I/O:
> 
> 		page_cache_sync_readahead(mapping, &in->f_ra, in,
> 				index, req_pages - spd.nr_pages);
> 
> And this waits for it to finish:
> 
> 		if (!PageUptodate(page)) {
> 			...
> 				lock_page(page);
> 
> The only way it will be async, is if there's no readahead.  But do we
> want to optmize that case?

It's an unfortunate side effect of the read-ahead, I'd much rather just
get rid of that. It _should_ behave like the non-ra case, when a page is
added it merely has IO started on it. So we want to have that be
something like

        if (!PageUptodate(page) && !PageInFlight(page))
                ...

basically like PageWriteback(), but for read-in.

-- 
Jens Axboe

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-06-24 11:19 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-21 15:46 [rfc patch 0/4] splice: cleanups and fixes Miklos Szeredi
2008-06-21 15:46 ` Miklos Szeredi
2008-06-21 15:46 ` [rfc patch 1/4] splice: fix comment Miklos Szeredi
2008-06-21 15:46   ` Miklos Szeredi, Miklos Szeredi
2008-06-21 15:46 ` [rfc patch 2/4] splice: remove steal from pipe_buf_operations Miklos Szeredi
2008-06-21 15:46   ` Miklos Szeredi, Miklos Szeredi
2008-06-24  8:01   ` Jens Axboe
2008-06-24  8:01     ` Jens Axboe
2008-06-24  8:50     ` Miklos Szeredi
2008-06-24  8:50       ` Miklos Szeredi
2008-06-24 12:21       ` Nick Piggin
2008-06-24 12:21         ` Nick Piggin
2008-06-21 15:46 ` [rfc patch 3/4] splice: remove confirm " Miklos Szeredi
2008-06-21 15:46   ` Miklos Szeredi, Miklos Szeredi
2008-06-24  8:04   ` Jens Axboe
2008-06-24  8:04     ` Jens Axboe
2008-06-24  8:54     ` Miklos Szeredi
2008-06-24  8:54       ` Miklos Szeredi
2008-06-24 11:19       ` Jens Axboe [this message]
2008-06-24 11:19         ` Jens Axboe
2008-06-24 11:36         ` Miklos Szeredi
2008-06-24 11:36           ` Miklos Szeredi
2008-06-24 11:46           ` Evgeniy Polyakov
2008-06-24 11:46             ` Evgeniy Polyakov
2008-06-24 12:02             ` Miklos Szeredi
2008-06-24 12:02               ` Miklos Szeredi
2008-06-24 12:15               ` Evgeniy Polyakov
2008-06-24 12:15                 ` Evgeniy Polyakov
2008-06-24 12:16           ` Nick Piggin
2008-06-24 12:16             ` Nick Piggin
2008-06-24 12:22             ` Jens Axboe
2008-06-24 12:22               ` Jens Axboe
2008-06-24 13:00             ` Miklos Szeredi
2008-06-24 13:00               ` Miklos Szeredi
2008-06-24 17:30           ` Linus Torvalds
2008-06-24 17:30             ` Linus Torvalds
2008-06-24 18:24             ` Miklos Szeredi
2008-06-24 18:24               ` Miklos Szeredi
2008-06-24 18:31               ` Linus Torvalds
2008-06-24 18:31                 ` Linus Torvalds
2008-06-24 19:05                 ` Miklos Szeredi
2008-06-24 19:05                   ` Miklos Szeredi
2008-06-24 19:17                   ` Linus Torvalds
2008-06-24 19:17                     ` Linus Torvalds
2008-06-24 19:24                     ` Miklos Szeredi
2008-06-24 19:24                       ` Miklos Szeredi
2008-06-24 19:26                       ` Miklos Szeredi
2008-06-24 19:26                         ` Miklos Szeredi
2008-06-24 19:32                         ` Miklos Szeredi
2008-06-24 19:32                           ` Miklos Szeredi
2008-06-24 19:47                           ` Linus Torvalds
2008-06-24 19:47                             ` Linus Torvalds
2008-06-24 20:06                             ` Miklos Szeredi
2008-06-24 20:06                               ` Miklos Szeredi
2008-06-24 19:45                       ` Linus Torvalds
2008-06-24 19:45                         ` Linus Torvalds
2008-06-21 15:46 ` [rfc patch 4/4] splice: use do_generic_file_read() Miklos Szeredi
2008-06-21 15:46   ` Miklos Szeredi, Miklos Szeredi
2008-06-24  8:05   ` Jens Axboe
2008-06-24  8:05     ` Jens Axboe
2008-06-24 11:11     ` Miklos Szeredi
2008-06-24 11:11       ` Miklos Szeredi
2008-06-21 17:20 ` [rfc patch 0/4] splice: cleanups and fixes Subrata Modak
2008-06-22  6:16   ` Miklos Szeredi
2008-06-23 15:26     ` Subrata Modak
2008-06-25 13:17       ` [LTP] " Subrata Modak
2008-06-25 14:00         ` Miklos Szeredi
     [not found]           ` <E1KBVXV-000618-C9-8f8m9JG5TPIdUIPVzhDTVZP2KDSNp7ea@public.gmane.org>
2008-06-26  7:34             ` Subrata Modak
2008-10-22 12:41               ` [LTP] " Subrata Modak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080624111913.GP20851@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=miklos@szeredi.hu \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.