<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 8, 2020, 00:01 Nir Soffer <<a href="mailto:nsoffer@redhat.com">nsoffer@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Aug 6, 2020 at 7:24 PM Richard W.M. Jones <<a href="mailto:rjones@redhat.com" target="_blank" rel="noreferrer">rjones@redhat.com</a>> wrote:<br>
><br>
> On Thu, Aug 06, 2020 at 06:46:06PM +0300, Nir Soffer wrote:<br>
> > Given the poor results, I suspect that that handles created using same<br>
> > connection share a lock. This also makes sense if connection abstract a<br>
> > blocking socket.<br>
><br>
> Nice theory, but it didn't work.  Again more handles = slower,<br>
> broadly speaking:<br>
><br>
> 16 coroutines, 16 handles:<br>
><br>
> real    1m36.920s<br>
> user    0m0.112s<br>
> sys     0m1.641s<br>
><br>
> 8 / 8:<br>
><br>
> real    1m27.946s<br>
> user    0m0.110s<br>
> sys     0m1.652s<br>
><br>
> 4 / 4:<br>
><br>
> real    1m23.027s<br>
> user    0m0.100s<br>
> sys     0m1.600s<br>
><br>
> 2 / 2:<br>
><br>
> real    1m6.089s<br>
> user    0m0.102s<br>
> sys     0m1.658s<br>
><br>
> 1 / 1:<br>
><br>
> real    1m9.540s<br>
> user    0m0.083s<br>
> sys     0m1.669s<br>
><br>
> The patch I'm using now is attached.<br>
<br>
There are 2 issues:<br>
<br>
1. We create the connection and handle with uninitialized memory, and later<br>
   with memory used by the previous connection/handle. This may not matter if<br>
   the library initializes all fields of the struct, but it is safer<br>
to zero the memory.<br>
<br>
2. We create the handlers in request threads, so most likely not in<br>
the same thread.<br>
   This may be ok, but risky.<br>
<br>
I moved the creation of all connections and handles to populate_pool(), called<br>
from vddk_open(). This may create more connections and handles than needed<br>
if the client does not use multiple inflight requests, but this is not<br>
important now.<br>
<br>
The code compiles but I cannot test it. Does it make any difference?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Richard, did you test this?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Nir<br>
<br>
<br>
><br>
> Rich.<br>
><br>
> --<br>
> Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer noreferrer" target="_blank">http://people.redhat.com/~rjones</a><br>
> Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
> virt-df lists disk usage of guests without needing to install any<br>
> software inside the virtual machine.  Supports Linux and Windows.<br>
> <a href="http://people.redhat.com/~rjones/virt-df/" rel="noreferrer noreferrer" target="_blank">http://people.redhat.com/~rjones/virt-df/</a><br>
</blockquote></div></div></div>