From 32c23136374d47aa7e4e54868aa2c10fd6aed476 Mon Sep 17 00:00:00 2001 From: Dave Lambley Date: Wed, 13 Feb 2013 11:09:48 +0000 Subject: [PATCH] Tell the kernel we're doing sequential reads. [ew: squashed Dave's change to make IO::AIO optional] Signed-off-by: Eric Wong --- lib/Mogstored/SideChannelClient.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Mogstored/SideChannelClient.pm b/lib/Mogstored/SideChannelClient.pm index f11f0e8..f3dbab3 100644 --- a/lib/Mogstored/SideChannelClient.pm +++ b/lib/Mogstored/SideChannelClient.pm @@ -12,6 +12,10 @@ use Digest; use POSIX qw(O_RDONLY); use Mogstored::TaskQueue; +BEGIN { + eval { require IO::AIO; }; +} + # TODO: interface to make this tunable my %digest_queues; @@ -128,6 +132,9 @@ sub digest { Perlbal::AIO::aio_open("$path$uri", O_RDONLY, 0, sub { my $fh = shift; + eval { + IO::AIO::fadvise(fileno($fh), 0, 0, IO::AIO::FADV_SEQUENTIAL); + }; if ($self->{closed}) { CORE::close($fh) if $fh; -- 2.11.4.GIT