All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Zhong <yang.zhong@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: yang.zhong@intel.com,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] The WCE issue in guest when i enable WCE in Qemu side.
Date: Wed, 24 Jul 2019 14:55:13 +0800	[thread overview]
Message-ID: <20190724065513.GA3369@yangzhon-Virtual> (raw)
In-Reply-To: <93e3762a-d906-6d6b-9a5f-7497af188f94@redhat.com>

On Tue, Jul 23, 2019 at 05:32:12PM +0200, Paolo Bonzini wrote:
> On 23/07/19 14:17, Zhong, Yang wrote:
> > When I set config-wce=true or false, the below value never change
> >  root@unicorn ~ # cat /sys/block/vda/cache_type
> > write back
> > root@unicorn ~ # cat /sys/block/vda/device/features
> > 0010 0010 0110 0110 0000 0000 0000 1000 1000 0000 0000 0000 0000 0000 0000 0000 
> > From left to right, bit 11=0, which show there is no WCE feature in vhost-user-blk device.
> 
> Does your backend expose the feature in the VHOST_GET_FEATURES message?

  Paolo, thanks for your comments.
  
  The get features value in vhost-user-blk is 0x154007646(bit 11 is 0), which
  does not include WCE feature in default of SPDK vhost-blk module.

> > I also did one simple patch to add config_wce value into s->blkcfg.wce, but the result is same.
> 
> config_wce doesn't tell you if you are in writeback or writethrough
> mode, it tells you if you can *change* the mode.
> 
> If your backend did not expose the feature, try changing that and then
> "echo write through > /sys/block/vda/cache_type" should work?
> 
  Paolo, yes, i enabled WCE feature in the backend code(SPDK), and did
  the test config-wce= true or false as below

  (1).config-wce=true in qemu command for vhosr-user-blk's perporty 
      ##root@unicorn ~ # cat /sys/block/vda/device/features
       0010 0010 0111 0110 000000000000100010000000000000000000000000000000 ---> bit 11 is "1", which support WCE feature.

     ##set the "write through"
       echo write through > /sys/block/vda/cache_type
       root@unicorn ~ # cat /sys/block/vda/cache_type
       write through

   (2).config-wce=false in qemu command for vhost-ser-blk
      root@unicorn ~ # cat /sys/block/vda/cache_type
      write back
      root@unicorn ~ # cat /sys/block/vda/device/features
      0010 0010 0110 0110 0000 0000 0000 1000 1000 0000 0000 00000000000000000000 ---> bit 11 is "0" because of config-wce=false
      root@unicorn ~ # echo "write through" > /sys/block/vda/cache_type
      -bash: /sys/block/vda/cache_type: Permission denied

      Only config-wce=true can change the cache mode, thanks.

      The SPDK code i am using is latest version, So, i feel we should enable WCE feature in SPDK side by default. thanks for your help!
       
      Yang
> Paolo


  reply	other threads:[~2019-07-24  7:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 12:17 [Qemu-devel] The WCE issue in guest when i enable WCE in Qemu side Zhong, Yang
2019-07-23 15:32 ` Paolo Bonzini
2019-07-24  6:55   ` Yang Zhong [this message]
2019-07-24  8:57     ` Paolo Bonzini
2019-07-24 12:47       ` Yang Zhong

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=20190724065513.GA3369@yangzhon-Virtual \
    --to=yang.zhong@intel.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.