From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAMIg-0007Oc-RO for qemu-devel@nongnu.org; Mon, 03 Feb 2014 11:23:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAMIa-0001Z2-Mi for qemu-devel@nongnu.org; Mon, 03 Feb 2014 11:23:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAMIa-0001Yy-Cj for qemu-devel@nongnu.org; Mon, 03 Feb 2014 11:23:04 -0500 Date: Mon, 3 Feb 2014 17:21:59 +0100 From: Kevin Wolf Message-ID: <20140203162159.GR3643@dhcp-200-207.str.redhat.com> References: <1391094138-26798-1-git-send-email-olaf@aepfle.de> <20140203154908.GO3643@dhcp-200-207.str.redhat.com> <20140203160325.GA29813@aepfle.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140203160325.GA29813@aepfle.de> Subject: Re: [Qemu-devel] [PATCH] xen_disk: add discard support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Olaf Hering Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, stefano.stabellini@eu.citrix.com Am 03.02.2014 um 17:03 hat Olaf Hering geschrieben: > On Mon, Feb 03, Kevin Wolf wrote: > > > Am 30.01.2014 um 16:02 hat Olaf Hering geschrieben: > > > + case BLKIF_OP_DISCARD: > > > + { > > > + struct blkif_request_discard *discard_req = (void *)&ioreq->req; > > > + bdrv_acct_start(blkdev->bs, &ioreq->acct, > > > + discard_req->nr_sectors * BLOCK_SIZE, BDRV_ACCT_WRITE); > > > > Neither SCSI nor IDE account for discards. I think we should keep the > > behaviour consistent across devices. > > > > If we do want to introduce accounting for discards, I'm not sure whether > > counting them as writes or giving them their own category makes more > > sense. > > This line was just copied. I have to look how virtio does it, maybe I > copied it from there. No problem with removing it from my side. virtio-blk doesn't support discard at all. I guess you just copied it from the write a few lines above (and you need it if you don't want to change the callback, because that has a bdrv_acct_end() call). > But I think in the end a discard is also a write, isnt it? Well... Not really, but perhaps close enough. I can think of arguments for either way. All that I'm really interested in is that all devices apply the same logic for accounting discards, so we can keep a consistent meaning of the statistics. If we want to account for them as writes here, we need to change IDE and SCSI to do the same; and if we leave IDE and SCSI unchanged, we can't account for discards here. Kevin