Re: Is there a "make hole" (truncate in middle) syscall?

From: Jörn Engel
Date: Fri Dec 12 2003 - 09:26:41 EST


On Fri, 12 December 2003 14:56:09 +0100, Jörn Engel wrote:
> On Fri, 12 December 2003 07:39:25 -0600, Rob Landley wrote:
> > On Friday 12 December 2003 06:55, Jörn Engel wrote:
> > >
> > > Yes, the obvious and stupid implementation has a ton of problems.
> > > Most likely the right approach is some sort of background deamon
> > > (garbage collector, defragmenter, journald, whatever you may call it)
> > > that does exacly this even after the fact for the last unchecked
> > > writes. Asyncronous under load, possibly even synchronous when almost
> > > idle.
> >
> > Actually, I'd planned on implementing a cron job that could do it. We're
> > talking a dozen lines of Python code (which can be optimized to only look at
> > files with timestamps since the last time it ran). And doesn't need anything
> > from the kernel but the syscall...
>
> ...and it sucks. Same problem as with updatedb - 99% of all work is
> bogus, but you don't know which 99%, because the one knowing about it,
> the kernel, doesn't tell you a thing.

Actually, updatedb sucks even worse. The database is notoriously
outdated and each run of updatedb has the effect of flushing the
cache. Because of the cache-flushing effect, you cannot even run it
with maximum niceness. Running it still hurts you *afterwards*.

Same goes for you userland daemon without kernel support.

Jörn

--
To recognize individual spam features you have to try to get into the
mind of the spammer, and frankly I want to spend as little time inside
the minds of spammers as possible.
-- Paul Graham
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/