From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5xS8-0008KJ-GC for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:53:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5xS2-0003A4-Dm for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:53:40 -0500 Received: from mail-lb0-f173.google.com ([209.85.217.173]:50101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5xS2-00039o-2z for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:53:34 -0500 Received: by lbon3 with SMTP id n3so313930lbo.4 for ; Fri, 09 Mar 2012 02:53:31 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4F59DEC6.8010509@redhat.com> References: <1331226917-6658-1-git-send-email-pbonzini@redhat.com> <1331226917-6658-15-git-send-email-pbonzini@redhat.com> <4F59DEC6.8010509@redhat.com> Date: Fri, 9 Mar 2012 10:53:31 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 14/17] block: support FALLOC_FL_PUNCH_HOLE trimming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Fri, Mar 9, 2012 at 10:43 AM, Paolo Bonzini wrote: > Il 09/03/2012 11:31, Stefan Hajnoczi ha scritto: >>> > +#ifdef FALLOC_FL_PUNCH_HOLE >>> > + =A0 =A0retval =3D fallocate(s->fd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_K= EEP_SIZE, >>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sector_num << 9, (int64= _t)nb_sectors << 9); >> I'm concerned about introducing blocking syscalls in coroutine code >> paths. =A0This needs to be done asynchronously. > > Right; it is no worse than what is already there, except that XFS could > use paio_ioctl. =A0Alternatives are: It is worse in the sense that if you make this feature more widely available then it deserves a production-quality implementation. > 1) require a new-enough kernel and only use fallocate; return a NULL > aiocb if !has_discard and convert it to ENOTSUP. > > 2) extract now from my threads branch the work to generalize > posix-aio-compat into a more flexible threadpool, and move the AIO code > back to block/raw-posix.c. 3) Add discard to posix-aio-compat.c as an AIO request? Stefan