From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXYxB-00056H-2b for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:05:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXYx3-0003bM-SA for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:05:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXYx3-0003WX-I1 for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:05:01 -0400 Message-ID: <54259CAF.6060904@redhat.com> Date: Fri, 26 Sep 2014 19:04:47 +0200 From: Max Reitz MIME-Version: 1.0 References: <1411622627-22110-1-git-send-email-tony@bakeyournoodle.com> <1411686852-26487-1-git-send-email-tony@bakeyournoodle.com> <1411686852-26487-2-git-send-email-tony@bakeyournoodle.com> In-Reply-To: <1411686852-26487-2-git-send-email-tony@bakeyournoodle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 2/2] block/raw-posix: use seek_hole ahead of fiemap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tony Breeds , qemu-devel@nongnu.org Cc: Kevin Wolf , =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= , Markus Armbruster , Stefan Hajnoczi On 26.09.2014 01:14, Tony Breeds wrote: > try_fiemap() uses FIEMAP_FLAG_SYNC which has a significant performance > impact. > > Prefer seek_hole() over fiemap() to avoid this impact where possible. > seek_hole is more widely used and, arguably, has potential to be > optimised in the kernel. > > Reported-By: Michael Steffens > Signed-off-by: Tony Breeds > Cc: Kevin Wolf > Cc: Markus Armbruster > Cc: Stefan Hajnoczi > Cc: Max Reitz > Cc: P=C3=A1draig Brady > Cc: Eric Blake > --- > Changes since v1: > - split in to 2 patches > - tried to make the commit messages better I used this order in at least one of the non-final versions of 4f11aa8a,=20 so I'm fine with it. The reason it got rejected was (as far as I=20 remember) that the FIEMAP ioctl() returns ENOTSUP if not supported,=20 whereas lseek() with SEEK_HOLE/SEEK_DATA returns some failsafe value,=20 probably reporting no holes at all. By reversing the order of=20 try_fiemap() and try_seek_hole(), try_fiemap() therefore may very well=20 become dead code. I don't object, however. Reviewed-by: Max Reitz