Re: optimal file order for reading from disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[email protected] writes:

> bert hubert wrote:
>> On Tue, Jun 14, 2005 at 12:21:40PM +0100, [email protected] wrote:
>>
>>>I know this will be dependent on filesystem, I/O scheduler, ...
>>>but given a list of files, what is the best (filesystem
>>>agnostic) order to read from disk (to minimise seeks).
>>>
>>>Should I sort by path, inode number, getdents, or something else?
>> I know several projects that sort on inode number and benefit from
>> that,
>> sometimes in a big way. The effect of this will probably be less on a
>> matured filesystem image.
>
> Thanks for that. Yep I'm torn between sorting by inode which
> should be good for new filesystems, but maybe sorting by
> path would be better for mature filesystems?

Sorting by either inode number, or file name is not "file system
agnostic" way to minimize seeks.

You should call fibmap ioctl on all files, to obtain lists of block
numbers used by them, and then sort file list to minimize seeks.

>
>> I can't really explain why it helps though. I don't think the kernel will do
>> 'crossfile readahead', although your disk might do so.
>> Google on 'orlov allocator', is enlightning.
>
> I found some interesting into here thanks:
> http://kerneltrap.org/node/2157
>
> cheers,
> Pádraig.

Nikita.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux