Re: Deleting large files

From: Jan Engelhardt
Date: Wed May 07 2008 - 16:10:59 EST



On Wednesday 2008-05-07 21:49, Morten Welinder wrote:

>Hi there,
>
>deleting large files, say on the order of 4.6GB, takes approximately forever.
>Why is that? Well, it is because a lot of things need to take place to free
>the formerly used space,

Only for a few filesystems which use that sort of housekeeping.

>but my real question is "why does the unlink caller have to wait for it?"

Same reason your shell waits for your program to complete before
showing the prompt again?

>I.e., could unlink do the directory changes and then hand off the rest of the
>task to a kernel thread?

Say you had one realtime application running that would do lots of new
writes after the unlink finished. When the unlink is put into the
background, you interleave the unlink operation with new writes,
probably causing needless seeks and therefore not hitting the deadlines
anymore.

For you desktop use, `rm -f foobar.avi &` should do. No?
--
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/