[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Parallelizing writing to network devices

> On 28 Nov 2014, at 10:54, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:
>> On 27 Nov 2014, at 16:56, Masoud Koleini <masoud.koleini@xxxxxxxxxxxxxxxx> 
>> wrote:
>> Hi all,
>> Wondering about the semantics of Lwt_ring and Netif.write. I am writing a 
>> code that sends an Lwt_stream of frames over a network device using 
>> Netif.write with highest possible rate and preferably respecting frame 
>> ordering. Another thread pushes frames into this stream.
>> To parallelize writing to the output device, a recursive iteration over the 
>> stream extracts every element using Lwt_stream.next, and calls Netif.write 
>> under Lwt.ignore_result. Threads stop functioning with no error printed on 
>> the console at high packet rates. Any suggestion?
> That should work, to my understanding. The next step is to figure out what's 
> blocking:
> - if an event is being lost, then try to prod the ring to wake up with 
> external stimulus (e.g. pinging the interface).
> - graph the ring utilisation to see if it's always full (Thomas Leonard's 
> profiling patches should help here)
> - try to reduce the parallelisation to see if some condition there alleviates 
> the issue to track it down.

Good advice.

As an aside, Iâm in the middle of functorising the ring code to make it more 
like Vchan. In particular youâll be able to instantiate the functor with any 
suitable memory sharing and event signalling primitives. This means weâll be 
able to run the code in several different environments

- in-process where memory sharing is trivial and event signalling uses 
Lwt_condition.t. This is good for unit-tests
- cross-process under Unix where memory sharing is via something like /dev/shm 
and signalling via eventfd or pipes? (Suggestions welcome)
- as a Xen backend/frontend under Linux where memory sharing is via 
gntdev/gntshr and events are via /dev/xen/evtchn
- under Xen as normal

I really want to be able to run 2 utop shells, #require the code, instantiate 
the functor for Unix and have Xen netfront/netback between regular processes 
under OS X.

MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.