[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <x49wqp7puej.fsf@segfault.boston.devel.redhat.com>
Date: Wed, 03 Jul 2013 10:53:08 -0400
From: Jeff Moyer <jmoyer@...hat.com>
To: Mel Gorman <mgorman@...e.de>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Dave Chinner <david@...morbit.com>,
Rob van der Heij <rvdheij@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Yannick Brosseau <yannick.brosseau@...il.com>,
stable@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
"lttng-dev\@lists.lttng.org" <lttng-dev@...ts.lttng.org>
Subject: Re: [-stable 3.8.1 performance regression] madvise POSIX_FADV_DONTNEED
Mel Gorman <mgorman@...e.de> writes:
>> > I just tried replacing my sync_file_range()+fadvise() calls and instead
>> > pass the O_DIRECT flag to open(). Unfortunately, I must be doing
>> > something very wrong, because I get only 1/3rd of the throughput, and
>> > the page cache fills up. Any idea why ?
>>
>> Since O_DIRECT does not seem to provide acceptable throughput, it may be
>> interesting to investigate other ways to lessen the latency impact of
>> the fadvise DONTNEED hint.
>>
>
> There are cases where O_DIRECT falls back to buffered IO which is why you
> might have found that page cache was still filling up. There are a few
> reasons why this can happen but I would guess the common cause is that
> the range of pages being written was in the page cache already and could
> not be invalidated for some reason. I'm guessing this is the common case
> for page cache filling even with O_DIRECT but would not bet money on it
> as it's not a problem I investigated before.
Even when O_DIRECT falls back to buffered I/O for writes, it will
invalidate the page cache range described by the buffered I/O once it
completes. For reads, the range is written out synchronously before the
direct I/O is issued. Either way, you shouldn't see the page cache
filling up.
Switching to O_DIRECT often incurs a performance hit, especially if the
application does not submit more than one I/O at a time. Remember,
you're not getting readahead, and you're not getting the benefit of the
writeback code submitting batches of I/O.
HTH,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists