qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] The WCE issue in guest when i enable WCE in Qemu side.


From: Yang Zhong
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
User-agent: Mutt/1.5.21 (2010-09-15)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]