qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: David Weber <wb@munzinger.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Strange problems with lseek in qemu-img map
Date: Wed, 3 Jun 2015 15:06:07 +0100	[thread overview]
Message-ID: <20150603140607.GC20862@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <8145574.73ivEs6Dzv@o3-3>

[-- Attachment #1: Type: text/plain, Size: 2052 bytes --]

On Tue, Jun 02, 2015 at 02:54:17PM +0200, David Weber wrote:
> Testcase:
> # qemu-img create test 500G
> # time qemu-img map test
> 
> Systems:
> O3-3: Kubuntu 15.04 Workstation with stock-kernel 3.19.0-18-generic and stock 
> qemu 2.2.0
> Dinah: Ubuntu Server 15.04 with stock-kernel 3.19.0-18-generic and stock qemu 
> 2.2.0

These systems have the same kernel but for some reason O3-3 completes
quickly while Dinah takes a long time in lseek(fd, offset, SEEK_DATA).
It looks like the file is empty (the syscall keeps returning ENXIO
because there are no allocated blocks in the file where qemu-img
probes).

> Result on O3-3:
> root@o3-3:~# qemu-img create test 500G
> Formatting 'test', fmt=raw size=536870912000 
> root@o3-3:~# time qemu-img map test
> Offset          Length          Mapped to       File
> 
> real    0m0.049s
> user    0m0.048s
> sys     0m0.000s
> 
> Result on dinah:
> root@dinah:~# qemu-img create test 500G
> Formatting 'test', fmt=raw size=536870912000 
> root@dinah:~# time qemu-img map test
> Offset          Length          Mapped to       File
> ^C
> 
> real    0m41.862s
> user    0m0.004s
> sys     0m0.068s
> (Stopped with ^C)
> 
> Strace on O3-3:
> https://gist.github.com/anonymous/f221035e9176f7c71c74
> 
> Strace on dinah:
> https://gist.github.com/anonymous/40b42888a65478c90b32
> 
> A git bisect between 1.7 and master revealed 
> 7c15903789953ead14a417882657d52dc0c19a24 "block/raw-posix: use seek_hole ahead 
> of fiemap" as bad but this is not the real problem.
> I also tried to switch from btrfs to ext4 but it didn't change anything.
> 
> At this point, I was pretty sure that was just stupit and missing something 
> trivial.
> I then startet a fedora 22 live system and I saw the same problem. It happens 
> on both the ramdisk and a ext4 filesystem.

"it" == qemu-img map hangs or takes a very long time?

Can you post a shell script that reproduces this with a ramdisk?  That
seems like the easiest way to get people debugging it.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-06-03 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 12:54 [Qemu-devel] Strange problems with lseek in qemu-img map David Weber
2015-06-03 14:06 ` Stefan Hajnoczi [this message]
2015-06-04  3:52   ` Wen Congyang
2015-06-04  1:19 ` Wen Congyang

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=20150603140607.GC20862@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wb@munzinger.de \
    /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;
as well as URLs for NNTP newsgroup(s).