Skip to contentSkip to conversation

vhost: fix unnecessary dirty page logging

PATCH Applied [email protected] 5 participants 12 messages Jul 7, 2022 – Jul 11, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: fix unnecessary dirty page logging

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve performance.

Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf refactoring")
Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")
---
 lib/vhost/virtio_net.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)
lib/vhost/virtio_net.c +13 -18
index e842c35fef..12b7fbe7f9 100644
@@ -1113,27 +1113,27 @@ sync_fill_seg(struct virtio_net *dev, struct vhost_virtqueue *vq,
 			rte_memcpy((void *)((uintptr_t)(buf_addr)),
 				rte_pktmbuf_mtod_offset(m, void *, mbuf_offset),
 				cpy_len);
+			vhost_log_cache_write_iova(dev, vq, buf_iova, cpy_len);
+			PRINT_PACKET(dev, (uintptr_t)(buf_addr), cpy_len, 0);
 		} else {
 			rte_memcpy(rte_pktmbuf_mtod_offset(m, void *, mbuf_offset),
 				(void *)((uintptr_t)(buf_addr)),
 				cpy_len);
 		}
-		vhost_log_cache_write_iova(dev, vq, buf_iova, cpy_len);
-		PRINT_PACKET(dev, (uintptr_t)(buf_addr), cpy_len, 0);
 	} else {
 		if (to_desc) {
 			batch_copy[vq->batch_copy_nb_elems].dst =
 				(void *)((uintptr_t)(buf_addr));
 			batch_copy[vq->batch_copy_nb_elems].src =
 				rte_pktmbuf_mtod_offset(m, void *, mbuf_offset);
+			batch_copy[vq->batch_copy_nb_elems].log_addr = buf_iova;
+			batch_copy[vq->batch_copy_nb_elems].len = cpy_len;
 		} else {
 			batch_copy[vq->batch_copy_nb_elems].dst =
 				rte_pktmbuf_mtod_offset(m, void *, mbuf_offset);
 			batch_copy[vq->batch_copy_nb_elems].src =
 				(void *)((uintptr_t)(buf_addr));
 		}
-		batch_copy[vq->batch_copy_nb_elems].log_addr = buf_iova;
-		batch_copy[vq->batch_copy_nb_elems].len = cpy_len;
 		vq->batch_copy_nb_elems++;
 	}
 }
@@ -2739,18 +2739,14 @@ desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
 			if (async_fill_seg(dev, vq, cur, mbuf_offset,
 					   buf_iova + buf_offset, cpy_len, false) < 0)
 				goto error;
+		} else if (likely(hdr && cur == m)) {
+			rte_memcpy(rte_pktmbuf_mtod_offset(cur, void *, mbuf_offset),
+				(void *)((uintptr_t)(buf_addr + buf_offset)),
+				cpy_len);
 		} else {
-			if (hdr && cur == m) {
-				rte_memcpy(rte_pktmbuf_mtod_offset(cur, void *, mbuf_offset),
-					(void *)((uintptr_t)(buf_addr + buf_offset)),
-					cpy_len);
-				vhost_log_cache_write_iova(dev, vq, buf_iova + buf_offset, cpy_len);
-				PRINT_PACKET(dev, (uintptr_t)(buf_addr + buf_offset), cpy_len, 0);
-			} else {
-				sync_fill_seg(dev, vq, cur, mbuf_offset,
-					buf_addr + buf_offset,
-					buf_iova + buf_offset, cpy_len, false);
-			}
+			sync_fill_seg(dev, vq, cur, mbuf_offset,
+				      buf_addr + buf_offset,
+				      buf_iova + buf_offset, cpy_len, false);
 		}
 
 		mbuf_avail  -= cpy_len;
@@ -2804,9 +2800,8 @@ desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
 		async_iter_finalize(async);
 		if (hdr)
 			pkts_info[slot_idx].nethdr = *hdr;
-	} else {
-		if (hdr)
-			vhost_dequeue_offload(dev, hdr, m, legacy_ol_flags);
+	} else if (hdr) {
+		vhost_dequeue_offload(dev, hdr, m, legacy_ol_flags);
 	}
 
 	return 0;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 118 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if- else judgements are also optimized to improve performance.

Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")
---
 lib/vhost/virtio_net.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)
lib/vhost/virtio_net.c index renamed from lib/vhost/virtio_net.c +0 -0

e842c35fef..12b7fbe7f9 100644

lib/vhost/virtio_net.c +4 -2
@@ -1113,27 +1113,27 @@ sync_fill_seg(struct virtio_net *dev, struct
 vhost_virtqueue *vq,
 			rte_memcpy((void *)((uintptr_t)(buf_addr)),
 				rte_pktmbuf_mtod_offset(m, void *,
 mbuf_offset),
 				cpy_len);
+			vhost_log_cache_write_iova(dev, vq, buf_iova,
 cpy_len);
+			PRINT_PACKET(dev, (uintptr_t)(buf_addr), cpy_len,
 0);
 		} else {
 			rte_memcpy(rte_pktmbuf_mtod_offset(m, void *,
 mbuf_offset),
 				(void *)((uintptr_t)(buf_addr)),
 				cpy_len);
 		}
-		vhost_log_cache_write_iova(dev, vq, buf_iova, cpy_len);
-		PRINT_PACKET(dev, (uintptr_t)(buf_addr), cpy_len, 0);
 	} else {
 		if (to_desc) {
 			batch_copy[vq->batch_copy_nb_elems].dst =
 				(void *)((uintptr_t)(buf_addr));
 			batch_copy[vq->batch_copy_nb_elems].src =
 				rte_pktmbuf_mtod_offset(m, void *,
 mbuf_offset);
+			batch_copy[vq->batch_copy_nb_elems].log_addr =
 buf_iova;
+			batch_copy[vq->batch_copy_nb_elems].len =
 cpy_len;
 		} else {
 			batch_copy[vq->batch_copy_nb_elems].dst =
 				rte_pktmbuf_mtod_offset(m, void *,

mbuf_offset);

lib/vhost/virtio_net.c +0 -1
 			batch_copy[vq->batch_copy_nb_elems].src =
 				(void *)((uintptr_t)(buf_addr));
 		}
-		batch_copy[vq->batch_copy_nb_elems].log_addr =

buf_iova;

lib/vhost/virtio_net.c +4 -7
-		batch_copy[vq->batch_copy_nb_elems].len = cpy_len;
 		vq->batch_copy_nb_elems++;
 	}
 }
@@ -2739,18 +2739,14 @@ desc_to_mbuf(struct virtio_net *dev, struct
 vhost_virtqueue *vq,
 			if (async_fill_seg(dev, vq, cur, mbuf_offset,
 					   buf_iova + buf_offset, cpy_len,
 false) < 0)
 				goto error;
+		} else if (likely(hdr && cur == m)) {
+			rte_memcpy(rte_pktmbuf_mtod_offset(cur, void *,
 mbuf_offset),
+				(void *)((uintptr_t)(buf_addr + buf_offset)),
+				cpy_len);
 		} else {
-			if (hdr && cur == m) {
-				rte_memcpy(rte_pktmbuf_mtod_offset(cur,
 void *, mbuf_offset),
-					(void *)((uintptr_t)(buf_addr +
 buf_offset)),
-					cpy_len);
-				vhost_log_cache_write_iova(dev, vq,
 buf_iova + buf_offset, cpy_len);
-				PRINT_PACKET(dev, (uintptr_t)(buf_addr +

buf_offset), cpy_len, 0);

lib/vhost/virtio_net.c +5 -8
-			} else {
-				sync_fill_seg(dev, vq, cur, mbuf_offset,
-					buf_addr + buf_offset,
-					buf_iova + buf_offset, cpy_len, false);
-			}
+			sync_fill_seg(dev, vq, cur, mbuf_offset,
+				      buf_addr + buf_offset,
+				      buf_iova + buf_offset, cpy_len, false);
 		}
 
 		mbuf_avail  -= cpy_len;
@@ -2804,9 +2800,8 @@ desc_to_mbuf(struct virtio_net *dev, struct
 vhost_virtqueue *vq,
 		async_iter_finalize(async);
 		if (hdr)
 			pkts_info[slot_idx].nethdr = *hdr;
-	} else {
-		if (hdr)
-			vhost_dequeue_offload(dev, hdr, m,
 legacy_ol_flags);
+	} else if (hdr) {
+		vhost_dequeue_offload(dev, hdr, m, legacy_ol_flags);
 	}
Quoted 3 lines

return 0;
--
2.17.1

Thanks,
Jiayu

Reviewed-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 16 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve performance.

Quoted 6 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")

---

Although it's late in release, we can consider to merge this as I see it impacts the performance by 5%:
http://inbox.dpdk.org/dev/BYAPR11MB2711F13CDA2B0A4535A6591EFE839@BYAPR11MB2711.namprd11.prod.outlook.com/T/#t

But also, it will be good to know the performance issue is solved by sharing the test results.

Thanks,
Chenbo

#3 lore raw
Quoted 20 lines · Chenbo
Quoted 20 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve performance.

Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")
Quoted 8 lines
Quoted 2 lines

---

Although it's late in release, we can consider to merge this as I see it impacts the performance by 5%:
http://inbox.dpdk.org/dev/BYAPR11MB2711F13CDA2B0A4535A6591EFE839@BYAPR11MB2711.namprd11.prod.outlook.com/T/#t

Yes, I raised we need it in -rc4 at today's Release status meeting. I'll review it today.

Quoted 2 lines

But also, it will be good to know the performance issue is solved by sharing the test results.

Yes, Intel performance results would be appreciated.

Quoted 3 lines

Thanks,
Chenbo

Thanks,
Maxime

author
#4 lore raw

Hi,

Quoted 46 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: 2022年7月7日 19:31
To: Xia, Chenbo <[email protected]>; Ding, Xuan <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>
Subject: Re: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 10 lines · Chenbo
Quoted 10 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 6 lines
Quoted 6 lines

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve

performance.

Quoted 5 lines
Quoted 5 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")
Quoted 8 lines
Quoted 2 lines

---

Although it's late in release, we can consider to merge this as I see it impacts the performance by 5%:

http://inbox.dpdk.org/dev/BYAPR11MB2711F13CDA2B0A4535A6591EFE839@B
YAPR

Quoted 1 line

11MB2711.namprd11.prod.outlook.com/T/#t

Quoted 7 lines

Yes, I raised we need it in -rc4 at today's Release status meeting. I'll review it today.

Quoted 2 lines

But also, it will be good to know the performance issue is solved by sharing the test results.

Yes, Intel performance results would be appreciated.

This fix patch is for the issue reported at 22.07-rc3. The refactoring patch brings a 3%~5% perf drop in vhost sync path. With fix patch, the perf drop introduced by refactoring is solved.

However, the testing result shows there still exists ~5% packed ring perf drop compared with 22.03. We find the improving checksum offload patch series in 22.07 may contribute to the packed ring perf drop. Because we always do checksum checks in PMD.

Could you help to double check this patch series, is it as expected? Your assistance is really appreciated.

Regards,
Xuan

Quoted 7 lines
Quoted 4 lines

Thanks,
Chenbo

Thanks,
Maxime

Tested-by
#5 lore raw
Quoted 66 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Friday, July 8, 2022 3:04 PM
To: Maxime Coquelin <[email protected]>; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>
Subject: RE: [PATCH] vhost: fix unnecessary dirty page logging

Hi,

Quoted 24 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: 2022年7月7日 19:31
To: Xia, Chenbo <[email protected]>; Ding, Xuan <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>
Subject: Re: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 10 lines · Chenbo
Quoted 10 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 22 lines
Quoted 7 lines
Quoted 7 lines

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve

performance.

Quoted 13 lines
Quoted 7 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")

---

Although it's late in release, we can consider to merge this as I see it impacts the performance by 5%:

http://inbox.dpdk.org/dev/BYAPR11MB2711F13CDA2B0A4535A6591EFE839
@B

Quoted 6 lines

YAPR

Quoted 1 line

11MB2711.namprd11.prod.outlook.com/T/#t

Yes, I raised we need it in -rc4 at today's Release status meeting. I'll review it today.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

But also, it will be good to know the performance issue is solved by sharing the test results.

Yes, Intel performance results would be appreciated.

This fix patch is for the issue reported at 22.07-rc3. The refactoring patch brings a 3%~5% perf drop in vhost sync path.
With fix patch, the perf drop introduced by refactoring is solved.

The fix is for a critical issue, I tested dpdk22.07-rc3 with the patch, the performance drop introduced by refactoring have been fixed and no other regressions were seen as a result of the patch, but the packed ring still exist drop around 5%.

Quoted 6 lines

However, the testing result shows there still exists ~5% packed ring perf drop compared with 22.03.
We find the improving checksum offload patch series in 22.07 may contribute to the packed ring perf drop.
Because we always do checksum checks in PMD.

I tested the performance of Vhost before and after checksum offload patch series, there exist ~5% performance drop.

Quoted 14 lines

Could you help to double check this patch series, is it as expected? Your assistance is really appreciated.

Regards,
Xuan

Quoted 7 lines
Quoted 4 lines

Thanks,
Chenbo

Thanks,
Maxime

#6 lore raw
Quoted 97 lines

-----Original Message-----
From: He, Xingguang <[email protected]>
Sent: Friday, July 8, 2022 3:53 PM
To: Ding, Xuan <[email protected]>; Maxime Coquelin <[email protected]>; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>
Subject: RE: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 10 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Friday, July 8, 2022 3:04 PM
To: Maxime Coquelin <[email protected]>; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>
Subject: RE: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 23 lines

Hi,

Quoted 21 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: 2022年7月7日 19:31
To: Xia, Chenbo <[email protected]>; Ding, Xuan <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>
Subject: Re: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 7 lines · Chenbo
Quoted 7 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX

<[email protected]>;

Quoted 20 lines
Quoted 20 lines
Quoted 11 lines
Quoted 11 lines

Jiang,
Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve

performance.

Quoted 8 lines
Quoted 7 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")

---

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Although it's late in release, we can consider to merge this as I see it impacts the performance by 5%:

http://inbox.dpdk.org/dev/BYAPR11MB2711F13CDA2B0A4535A6591EFE839

Quoted 7 lines

@B

Quoted 6 lines

YAPR

Quoted 1 line

11MB2711.namprd11.prod.outlook.com/T/#t

Yes, I raised we need it in -rc4 at today's Release status meeting. I'll review it today.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

But also, it will be good to know the performance issue is solved by sharing the test results.

Yes, Intel performance results would be appreciated.

This fix patch is for the issue reported at 22.07-rc3. The refactoring patch brings a 3%~5% perf drop in vhost sync path.
With fix patch, the perf drop introduced by refactoring is solved.

The fix is for a critical issue, I tested dpdk22.07-rc3 with the patch, the performance drop introduced by refactoring have been fixed and no other regressions were seen as a result of the patch, but the packed ring still exist drop around 5%.

Quoted 1 line
Quoted 8 lines
Quoted 5 lines

However, the testing result shows there still exists ~5% packed ring perf drop compared with 22.03.
We find the improving checksum offload patch series in 22.07 may contribute to the packed ring perf drop.
Because we always do checksum checks in PMD.

I tested the performance of Vhost before and after checksum offload patch series, there exist ~5% performance drop.

Sorry, the drop of checksum offload patch series is ~3%. The drop between DPDK22.03 and DPDK22.07-rc3 is ~5%.

Quoted 15 lines
Quoted 15 lines

Could you help to double check this patch series, is it as expected? Your assistance is really appreciated.

Regards,
Xuan

Quoted 7 lines
Quoted 4 lines

Thanks,
Chenbo

Thanks,
Maxime

#7 lore raw
In reply to Ding, Xuan

Hi,

Quoted 51 lines · Xuan

Hi,

Quoted 49 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: 2022年7月7日 19:31
To: Xia, Chenbo <[email protected]>; Ding, Xuan <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>
Subject: Re: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 10 lines · Chenbo
Quoted 10 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 6 lines
Quoted 6 lines

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve

performance.

Quoted 5 lines
Quoted 5 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")
Quoted 8 lines
Quoted 2 lines

---

Although it's late in release, we can consider to merge this as I see it impacts the performance by 5%:

http://inbox.dpdk.org/dev/BYAPR11MB2711F13CDA2B0A4535A6591EFE839@B
YAPR

Quoted 1 line

11MB2711.namprd11.prod.outlook.com/T/#t

Yes, I raised we need it in -rc4 at today's Release status meeting. I'll review it today.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

But also, it will be good to know the performance issue is solved by sharing the test results.

Yes, Intel performance results would be appreciated.

This fix patch is for the issue reported at 22.07-rc3. The refactoring patch brings a 3%~5% perf drop in vhost sync path. With fix patch, the perf drop introduced by refactoring is solved.

Good.

Quoted 6 lines

However, the testing result shows there still exists ~5% packed ring perf drop compared with 22.03. We find the improving checksum offload patch series in 22.07 may contribute to the packed ring perf drop. Because we always do checksum checks in PMD.

Could you help to double check this patch series, is it as expected? Your assistance is really appreciated.

I will look again, but if your analysis is right, there's not much we can do. The series is filling gaps in the checksum offload support.

I will not have time to work on it for v22.07, we're too late in the cycle. What surprises me is that only packed ring is impacted.

Regards,
Maxime

Quoted 12 lines

Regards,
Xuan

Quoted 7 lines
Quoted 4 lines

Thanks,
Chenbo

Thanks,
Maxime

author
#8 lore raw
Quoted 83 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: 2022年7月8日 15:58
To: Ding, Xuan <[email protected]>; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>
Subject: Re: [PATCH] vhost: fix unnecessary dirty page logging

Hi,

Quoted 48 lines · Xuan

Hi,

Quoted 46 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: 2022年7月7日 19:31
To: Xia, Chenbo <[email protected]>; Ding, Xuan <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>
Subject: Re: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 10 lines · Chenbo
Quoted 10 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 7 lines
Quoted 7 lines

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve

performance.

Quoted 13 lines
Quoted 7 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")

---

Although it's late in release, we can consider to merge this as I see it impacts the performance by 5%:

http://inbox.dpdk.org/dev/BYAPR11MB2711F13CDA2B0A4535A6591EFE839@B

Quoted 6 lines
Quoted 6 lines

YAPR

Quoted 1 line

11MB2711.namprd11.prod.outlook.com/T/#t

Yes, I raised we need it in -rc4 at today's Release status meeting. I'll review it today.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

But also, it will be good to know the performance issue is solved by sharing the test results.

Yes, Intel performance results would be appreciated.

This fix patch is for the issue reported at 22.07-rc3. The refactoring patch

brings a 3%~5% perf drop in vhost sync path.

Quoted 1 line

With fix patch, the perf drop introduced by refactoring is solved.

Good.

Quoted 1 line

However, the testing result shows there still exists ~5% packed ring perf drop

compared with 22.03.

Quoted 1 line

We find the improving checksum offload patch series in 22.07 may contribute

Quoted 8 lines

to the packed ring perf drop.

Quoted 4 lines

Because we always do checksum checks in PMD.

Could you help to double check this patch series, is it as expected? Your assistance is really appreciated.

I will look again, but if your analysis is right, there's not much we can do. The series is filling gaps in the checksum offload support.

Yes, I think so.

Quoted 3 lines

I will not have time to work on it for v22.07, we're too late in the cycle. What surprises me is that only packed ring is impacted.

From the testing results, the packed ring is more sensitive to the patch series, while split ring shows a much lower drop in performance.

Thanks for your support!

Regards,
Xuan

Quoted 16 lines

Regards,
Maxime

Quoted 12 lines

Regards,
Xuan

Quoted 7 lines
Quoted 4 lines

Thanks,
Chenbo

Thanks,
Maxime

#9 lore raw

Hi,

Quoted 72 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Friday, July 8, 2022 4:09 PM
To: Maxime Coquelin <[email protected]>; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang, Cheng1 <[email protected]>
Subject: RE: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 11 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: 2022年7月8日 15:58
To: Ding, Xuan <[email protected]>; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>
Subject: Re: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 26 lines

Hi,

Quoted 23 lines · Xuan

Hi,

Quoted 21 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: 2022年7月7日 19:31
To: Xia, Chenbo <[email protected]>; Ding, Xuan <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX <[email protected]>; Jiang,
Cheng1 <[email protected]>
Subject: Re: [PATCH] vhost: fix unnecessary dirty page logging

Quoted 7 lines · Chenbo
Quoted 7 lines

-----Original Message-----
From: Ding, Xuan <[email protected]>
Sent: Thursday, July 7, 2022 2:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; Hu, Jiayu <[email protected]>; He, Xingguang <[email protected]>; Yang, YvonneX

<[email protected]>;

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 11 lines
Quoted 11 lines

Jiang,
Cheng1 <[email protected]>; Ding, Xuan <[email protected]>
Subject: [PATCH] vhost: fix unnecessary dirty page logging

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve

performance.

Quoted 10 lines
Quoted 7 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf

refactoring")

Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")

---

Quoted 38 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

Although it's late in release, we can consider to merge this as I see it impacts the performance by 5%:

http://inbox.dpdk.org/dev/BYAPR11MB2711F13CDA2B0A4535A6591EFE839
@B

Quoted 31 lines
Quoted 6 lines
Quoted 6 lines

YAPR

Quoted 1 line

11MB2711.namprd11.prod.outlook.com/T/#t

Yes, I raised we need it in -rc4 at today's Release status meeting. I'll review it today.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

But also, it will be good to know the performance issue is solved by sharing the test results.

Yes, Intel performance results would be appreciated.

This fix patch is for the issue reported at 22.07-rc3. The refactoring patch

brings a 3%~5% perf drop in vhost sync path.

Quoted 1 line

With fix patch, the perf drop introduced by refactoring is solved.

Good.

Quoted 2 lines

However, the testing result shows there still exists ~5% packed ring perf drop

compared with 22.03.

Quoted 2 lines

We find the improving checksum offload patch series in 22.07 may contribute

to the packed ring perf drop.

Quoted 4 lines

Because we always do checksum checks in PMD.

Could you help to double check this patch series, is it as expected? Your assistance is really appreciated.

I will look again, but if your analysis is right, there's not much we can do. The series is filling gaps in the checksum offload support.

What is the result of your investigation? As dpdk-22.07 will be released soon, I'd like to know your advice about this issue. Thanks.

Quoted 4 lines

Yes, I think so.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

I will not have time to work on it for v22.07, we're too late in the cycle. What surprises me is that only packed ring is impacted.

From the testing results, the packed ring is more sensitive to the patch series, while split ring shows a much lower drop in performance.

Thanks for your support!

Regards,
Xingguang

Quoted 19 lines

Regards,
Xuan

Quoted 16 lines

Regards,
Maxime

Quoted 12 lines

Regards,
Xuan

Quoted 7 lines
Quoted 4 lines

Thanks,
Chenbo

Thanks,
Maxime

Reviewed-by on v1 1/1
#10 lore raw
In reply to [email protected]
Quoted 7 lines · On 7/7/22 08:55, [email protected] wrote:

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve performance.

Quoted 8 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf refactoring")
Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")
---
  lib/vhost/virtio_net.c | 31 +++++++++++++------------------
  1 file changed, 13 insertions(+), 18 deletions(-)

Thanks,
Maxime

#11 lore raw
In reply to [email protected]
Quoted 7 lines · On 7/7/22 08:55, [email protected] wrote:

From: Xuan Ding <[email protected]>

The dirty page logging is only required in vhost enqueue direction for live migration. This patch removes the unnecessary dirty page logging in vhost dequeue direction. Otherwise, it will result in a performance drop. Some if-else judgements are also optimized to improve performance.

Quoted 8 lines
Fixes 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf refactoring")
Fixes b6eee3e83402 ("vhost: fix sync dequeue offload")
---
  lib/vhost/virtio_net.c | 31 +++++++++++++------------------
  1 file changed, 13 insertions(+), 18 deletions(-)

Applied to dpdk-next-virtio/main.

Thanks,
Maxime