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

Re: Speeding up dpkg, a proposal



Hi,

On Thu, 03 Mar 2011, Phillip Susi wrote:
> I have another proposal.  It looks like right now dpkg extracts all of
> the files in the archive, then for each one, calls fsync() then
> rename().  Because this is done serially for each file in the archive,
> it forces small, out of order writes that cause extra seeking and queue
> plugging.

That's wrong. The writeback is initiated before the fsync() so the
filesystem can order the write how it wants.

And we use some linux specific ioctl to avoid that fragmentation.

> It would be much better to use aio to queue up all of the syncs at once,
> so that the elevator can coalesce and reorder them for optimal writing.

I'm not convinced it would help. You're welcome to try and provide a
patch if it works.

I'm not even convinced it's possible with the existing interfaces (but I
have no experience with AIO). aio_fsync() is only usable with aio_write()
and it's not possible to use lio_listio() to batch a bunch of aio_fsync().

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)


Reply to: