vhost: avoid concurrency when logging dirty pages
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Wed, 21 Mar 2018 15:44:13 +0000 (16:44 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:44 +0000 (14:08 +0200)
commit394313fff39d0f994325c47f7eab39daf5dc9e11
treecb869008507fe763123308509fa4d6f2a53b3622
parentf0e1180cb6a99825587ce4c108c4366023ac1f63
vhost: avoid concurrency when logging dirty pages

This patch aims at fixing a migration performance regression
faced since atomic operation is used to log pages as dirty when
doing live migration.

Instead of setting a single bit by doing an atomic read-modify-write
operation to log a page as dirty, this patch write 0xFF to the
corresponding byte, and so logs 8 page as dirty.

The advantage is that it avoids concurrent atomic operations by
multiple PMD threads, the drawback is that some clean pages are
marked as dirty and so are transferred twice.

Fixes: 897f13a1f726 ("vhost: make page logging atomic")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
lib/librte_vhost/vhost.h