So does it cost a lot to read all the extents just to read the first block? I don't generally open a file without immediately reading some block, so it doesn't really matter to me if there is a high cost for open() or a high cost for the first read().<div>
<br></div><div>-Bradley<br><br><div class="gmail_quote">On Tue, Jan 15, 2013 at 4:31 PM, Florian Weimer <span dir="ltr"><<a href="mailto:fw@deneb.enyo.de" target="_blank">fw@deneb.enyo.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Dave Chinner:<br>
<div><div class="h5"><br>
> On Sun, Jan 13, 2013 at 01:49:41PM -0600, Ben Myers wrote:<br>
>> On Sun, Jan 13, 2013 at 11:36:27AM -0500, Bradley C. Kuszmaul wrote:<br>
>> > On Sun, Jan 13, 2013 at 4:26 AM, Florian Weimer <<a href="mailto:fw@deneb.enyo.de">fw@deneb.enyo.de</a>> wrote:<br>
>> > > I once was a heavy Berkeley DB user and had files with dozens<br>
>> > > of gigabytes containing hundreds of thousands of extents, and<br>
>> > > open() times in the order of minutes were not unusual with a<br>
>> > > cold cache and other concurrent read activities from the same<br>
>> > > RAID device.<br>
>><br>
>> Ouch. I would not have expected open times that bad.<br>
><br>
> That will only happen if the extent list needs to be read during the<br>
> open() call. That will only occur if O_TRUNC is set. Otherwise, the<br>
> extents are read on the first syscall that needs them to be read in<br>
> (read, write, alloc, punch, truncate, etc) and that's when the<br>
> latency occurs.<br>
<br>
</div></div>Indeed, I think I have misremembered. The delay occurred when<br>
Berkeley DB tried to read the first page from disk.<br>
</blockquote></div><br></div>