On Wed, Dec 09, 2015 at 05:44:11AM +0000, Xie, Huawei wrote: > On 12/9/2015 11:41 AM, Yuanhan Liu wrote: > > On Wed, Dec 09, 2015 at 03:33:16AM +0000, Xie, Huawei wrote: > > ... > >>>> +static inline void __attribute__((always_inline)) > >>>> +vhost_log_write(struct virtio_net *dev, struct vhost_virtqueue *vq, > >>>> + uint64_t offset, uint64_t len) > >>>> +{ > >>>> + uint64_t addr = vq->log_guest_addr; > >>>> + uint64_t page; > >>>> + > >>>> + if (unlikely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) == 0) > >>>> || > >>>> + !dev->log_base || !len)) > >>>> + return; > >>> Isn't "likely" more appropriate in above, since the whole > >>> expression is expected to be true most of the time? > >> Victor: > >> So we are not always logging, what is the message that tells the backend > >> the migration is started? > > When log starts, VHOST_USER_SET_FEATURES request will be sent again, > > with VHOST_F_LOG_ALL feature bit set. > As the VHOST_USER_SET_FEATURES handling and rx/tx runs asynchronously, > we have to make sure we don't miss logging anything when this feature is > set.
That's a good remind. Thanks. > For example, I doubt like in virtio_dev_rx, is the dev->features > volatile? No, it is not volatile. --yliu