qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Qemu-devel] [PATCH] xen_disk: add discard support
Date: Mon, 3 Feb 2014 17:21:59 +0100	[thread overview]
Message-ID: <20140203162159.GR3643@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <20140203160325.GA29813@aepfle.de>

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

  reply	other threads:[~2014-02-03 16:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 15:02 [Qemu-devel] [PATCH] xen_disk: add discard support Olaf Hering
2014-01-30 15:22 ` Stefano Stabellini
2014-02-03 15:49 ` Kevin Wolf
2014-02-03 16:03   ` Olaf Hering
2014-02-03 16:21     ` Kevin Wolf [this message]
2014-02-03 16:12   ` Paolo Bonzini
2014-02-04 15:47   ` Olaf Hering
2014-02-04 15:49     ` Stefano Stabellini
2014-02-04 16:15     ` Kevin Wolf
2014-02-04 16:51       ` Olaf Hering
2014-02-04 16:58         ` Olaf Hering
2014-02-05 18:07           ` Stefano Stabellini

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=20140203162159.GR3643@dhcp-200-207.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=olaf@aepfle.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=stefano.stabellini@eu.citrix.com \
    /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).