linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@ubuntu.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Eric Wong <normalperson@yhbt.net>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fadvise: perform WILLNEED readahead in a workqueue
Date: Fri, 22 Feb 2013 11:45:23 -0500	[thread overview]
Message-ID: <5127A0A3.6040904@ubuntu.com> (raw)
In-Reply-To: <20121216024520.GH9806@dastard>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/15/2012 9:45 PM, Dave Chinner wrote:
> On Sat, Dec 15, 2012 at 12:54:48AM +0000, Eric Wong wrote:
>> Applications streaming large files may want to reduce disk
>> spinups and I/O latency by performing large amounts of readahead
>> up front. Applications also tend to read files soon after opening
>> them, so waiting on a slow fadvise may cause unpleasant latency
>> when the application starts reading the file.
>> 
>> As a userspace hacker, I'm sometimes tempted to create a
>> background thread in my app to run readahead().  However, I
>> believe doing this in the kernel will make life easier for other
>> userspace hackers.
>> 
>> Since fadvise makes no guarantees about when (or even if)
>> readahead is performed, this change should not hurt existing
>> applications.
>> 
>> "strace -T" timing on an uncached, one gigabyte file:
>> 
>> Before: fadvise64(3, 0, 0, POSIX_FADV_WILLNEED) = 0 <2.484832> 
>> After: fadvise64(3, 0, 0, POSIX_FADV_WILLNEED) = 0 <0.000061>
> 
> You've basically asked fadvise() to readahead the entire file if
> it can. That means it is likely to issue enough readahead to fill
> the IO queue, and that's where all the latency is coming from. If
> all you are trying to do is reduce the latency of the first read,
> then only readahead the initial range that you are going to need to
> read...

It shouldn't take 2 seconds to queue up some async reads.  Are you
using ext3?  The blocks have to be mapped in order to queue the reads,
and without ext4 extents, this means the indirect blocks have to be
read and can cause fadvise to block.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRJ6CjAAoJEJrBOlT6nu759s8IAKmIyZYDk1JSRP6oJaGaGZ/r
aZCBH52wTPH8DaqFGe+62L8lyIQ5hD15Y+zTuaWh+fJ7C1k/lU8F/QbKCG2D+xCB
vfLF0WRx63fWLLg8xZTRU1x8X6sG+Byp+UYWNspTDrL15ChlaqqGGmwLNo4JxLa8
+AGQVt1WMU3TitD9CUMUfYFWGUQsMR0gWeJkJnjHiEZ7VoGzft2PTlnvElzIk76u
3cmwfoKHrnXzi50rPtP2gonRjMwd8VY859qOk0zlHoMDMcXklAWeIN9PEUIMx+VP
fMnBm6u48cKXPYGvQrGMOdjxlt7k4LhGDZxIlvmwNHWUSaifmkJ8oBMvfbAYtUA=
=G5rE
-----END PGP SIGNATURE-----

  parent reply	other threads:[~2013-02-22 16:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-15  0:54 [PATCH] fadvise: perform WILLNEED readahead in a workqueue Eric Wong
2012-12-15 22:34 ` Alan Cox
2012-12-16  0:25   ` Eric Wong
2012-12-16  3:03     ` Dave Chinner
2012-12-16  3:35       ` Eric Wong
2012-12-16  4:15         ` Dave Chinner
2012-12-16  5:23           ` Eric Wong
2012-12-16 21:31             ` Dave Chinner
2012-12-16  8:48           ` Zheng Liu
2012-12-16  2:45 ` Dave Chinner
2012-12-16  3:04   ` Eric Wong
2012-12-16  3:09     ` Eric Wong
2012-12-16  3:36     ` Dave Chinner
2012-12-16  3:59       ` Eric Wong
2012-12-16  4:26         ` Dave Chinner
2012-12-16  5:17           ` Eric Wong
2013-02-22 16:45   ` Phillip Susi [this message]
2013-02-22 21:13     ` Eric Wong

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=5127A0A3.6040904@ubuntu.com \
    --to=psusi@ubuntu.com \
    --cc=david@fromorbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=normalperson@yhbt.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).