From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5xIL-0005BX-5w for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:43:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5xIC-0001Qy-GR for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:43:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5xIC-0001Qh-8b for qemu-devel@nongnu.org; Fri, 09 Mar 2012 05:43:24 -0500 Message-ID: <4F59DEC6.8010509@redhat.com> Date: Fri, 09 Mar 2012 11:43:18 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1331226917-6658-1-git-send-email-pbonzini@redhat.com> <1331226917-6658-15-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Il 09/03/2012 11:31, Stefan Hajnoczi ha scritto: >> > +#ifdef FALLOC_FL_PUNCH_HOLE >> > + retval = fallocate(s->fd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE, >> > + sector_num << 9, (int64_t)nb_sectors << 9); > I'm concerned about introducing blocking syscalls in coroutine code > paths. This needs to be done asynchronously. Right; it is no worse than what is already there, except that XFS could use paio_ioctl. Alternatives are: 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. Paolo