Control: retitle -1 dpkg: package install can be very slow with some disks due 
to too frequent fsync

Hi,

On 2019-04-09 00:33:27 +0200, Guillem Jover wrote:
> On Tue, 2019-03-05 at 15:43:05 +0100, Vincent Lefevre wrote:
> > zira:~> iozone -a -e
> > [...]
> >                                                               random    
> > random     bkwd    record    stride                                    
> >               kB  reclen    write  rewrite    read    reread    read     
> > write     read   rewrite      read   fwrite frewrite    fread  freread
> >               64       4     1821     1987     1922     3703     3657     
> > 1770     1621      1628      1697     1707     1773  1879725  2892445
> >               64       8     1606     1684     1713     3493     3476     
> > 1700     1765      1730      1812     2135     1852  2278628  3406295
> >               64      16     1807     1823     1986     3898     3798     
> > 1977     1813      1988      1871     2049     3320  2561267  4018152
> >               64      32     1702     1714     1755     3494     3683     
> > 1741     1841      1796      1737     1633     1674  1879725  4018152
> >               64      64     1808     1790     1632     3314     3387     
> > 2254     1995      1843      1984     1789     1820  2801873  3203069
> > [...]
> 
> Ok, can we conclude this is not a problem in dpkg then? :)

I'm not sure. This may just be a slow disk after all, and in practice
(I mean except benchmarking), the problem seems specific to dpkg.
I assume that programs normally don't do a fsync at every fraction
of microsecond! I don't know what dpkg is trying to achieve with such
a frequency of fsync, but this doesn't seem to make sense to me. You
had said "which has been the solution to earlier problems with ext4",
but the real solution would be to fix ext4 (does "earlier" mean this
has eventually been fixed?).

> It seems to me either hardware, filesystem or kernel related as
> mentioned before.

I've seen https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1785020
"fsync is slow on later kernels with ext4 filesystms" but the comments
in this bug page and 4.19.28-1 kernel logs show that this has been
fixed.

FYI, I get very similar timings on the same machine, but on /boot,
which is:

/dev/sda1 on /boot type ext2 
(rw,relatime,block_validity,barrier,user_xattr,acl,stripe=4)

The fact that the main, ext4 partition is encrypted but not this
one makes another difference, but the timings are similar, so that
this doesn't seem to be related to the FS system itself and appears
to be at a lower level.

Note also that my machine is a laptop, and I couldn't do a comparison
with other laptops, just in case.

> Could you reassign where you think it would be more appropriate?

I think that this should still be regarded as a dpkg bug, based on
my first paragraph above (the fsync's occur much too often in dpkg
compared to other programs, and this doesn't seem to be useful).

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to