Re: [Ext2-devel] disk throughput

Linus Torvalds
2001-11-05T23:03:22Z

In article <3BE70717.54F3084A@zip.com.au>,
Andrew Morton <akpm@zip.com.au> wrote:
>> if ( 0 && ..
>> use something like
>> if ((last_time + 100) < jiffes && ...
>> last_time = jiffies;
>> which would in theory use the old behaviour for sparodic mkdirs
>> and the new behaviour for things like 'untar' et al.
>>
>
>I agree - that's a pretty sane heuristic.
>
>It would allow us to preserve the existing semantics for the
>slowly-accreting case. If they're still valid.

I don't particularly like behaviour that changes over time, so I would
much rather just state clearly that the current inode allocation
strategy is obviously complete crap. Proof: simple real-world
benchmarks, along with some trivial thinking about seek latencies.

In particular, the way it works now, it will on purpose try to spread
out inodes over the whole disk. Every new directory will be allocated in
the group that has the most free inodes, which obviously on average
means that you try to fill up all groups equally.

Which makes _no_ sense. There is no advantage to trying to spread things
out, only clear disadvantages.

Instead of trying to make this time-dependent, let's just realize that
spreading things out is stupid. It might make more sense to say

- if we create a new directory
- AND the group we're currently in is getting filled up
- AND there is another group that is clearly emptier,
- THEN do we switch groups.

None of this stupid "if this group has more inodes than the average"
crap.

But I'd rather have the "if (0 && .." than something that depends on
time. But if people want to have something that is in the _spirit_ of
the old code, then make it something like the above, which only switches
groups if there is a need and a clear win from it.

Linus