|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 4/7] xenguest: Reduce number of I/O vectors in write_batch
From: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
Each page was sent using a different iovec item. This potentially exceed
Linux maximum (1024).
Also some implementation (MiniOS) emulate writev with multiple write calls.
Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>
---
tools/libs/guest/xg_sr_save.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 1700d819051a..62a39dfecc7a 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -240,13 +240,20 @@ static int write_batch(struct xc_sr_context *ctx)
{
for ( i = 0; i < nr_pfns; ++i )
{
- if ( guest_data[i] )
+ if ( !guest_data[i] )
+ continue;
+
+ if ( iov[iovcnt-1].iov_base + iov[iovcnt-1].iov_len !=
guest_data[i] )
{
iov[iovcnt].iov_base = guest_data[i];
iov[iovcnt].iov_len = PAGE_SIZE;
iovcnt++;
- --nr_pages;
}
+ else
+ {
+ iov[iovcnt-1].iov_len += PAGE_SIZE;
+ }
+ --nr_pages;
}
}
--
2.53.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |