public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Gernot Hillier <gernot.hillier@siemens.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: unexpected sync delays in dpkg for small pre-allocated files on ext4
Date: Thu, 26 May 2016 12:20:20 +1000	[thread overview]
Message-ID: <20160526022020.GG26977@dastard> (raw)
In-Reply-To: <57448A5D.4050805@siemens.com>

On Tue, May 24, 2016 at 07:07:41PM +0200, Gernot Hillier wrote:
> Hi there!
> 
> We experience strange delays with kernel 4.1.18 during dpkg package
> installation on an ext4 filesystem after switching from Ubuntu 14.04 to
> 16.04. We can reproduce the issue with kernel 4.6. Installation of the
> same package takes 2s with ext3 and 31s with ext4 on the same partition.
> 
> Hardware is an Intel-based server with Supermicro X8DTH board and
> Seagate ST973451SS disks connected to an LSI SAS2008 controller (PCI
> 0x1000:0x0072, mpt2sas driver).
> 
> We could track this down to the introduction of fallocate() in recent
> dpkg versions and derived the following synthetic test case. First
> sync_file_range() call takes ~5ms, 2nd call ~15ms.
> 
> 	fd = open("test1.txt", 0xc1);
> 	ret = fallocate(fd, 0, 0, 20);
> 	ret = write(fd, "hallo", 6);
> 	ret = sync_file_range(fd, 0, 0, 2);
> 	ret = close(fd);
> 
> 	fd = open("test2.txt", 0xc1);
> 	ret = fallocate(fd, 0, 0, 20);
> 	ret = write(fd, "hallo", 6);
> 	ret = sync_file_range(fd, 0, 0, 2);
> 	ret = close(fd);

Stupid question: why is dpkg using fallocate() for such small ranges
like that? I can't think of a more inefficient way to do small IO -
using delayed allocation is far more optimal from a layout,
overhead, latency and IO perspective than the above forced
allocation pseudo-synchronous write behaviour.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2016-05-26  2:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 17:07 unexpected sync delays in dpkg for small pre-allocated files on ext4 Gernot Hillier
2016-05-24 23:13 ` Theodore Ts'o
2016-05-30  8:27   ` Gernot Hillier
2016-05-31  0:21     ` Dave Chinner
2016-06-01  9:44       ` Gernot Hillier
2016-06-01 13:17         ` Gernot Hillier
2016-06-01 14:12           ` Theodore Ts'o
2016-06-02 16:23             ` Gernot Hillier
2016-07-13 13:57             ` Gernot Hillier
2016-05-26  2:20 ` Dave Chinner [this message]
2016-05-26  7:02   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2016-05-30 19:04 Jun He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160526022020.GG26977@dastard \
    --to=david@fromorbit.com \
    --cc=gernot.hillier@siemens.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox