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

Re: [UNIKRAFT PATCH 0/5] Introduce Ring Buffer Implementation



Hi Alexander,

I have a curiosity. Why don't you put this ring implementation in a
library of its own, e.g. ukring or smth? I thought that library
granularity was one of the strong points of Unikraft. Besides, this ring
implementation may be subject to more configuration options in the
future which would complicate the ukmpi configuration space.

Cheers,
Costin

On 7/20/20 7:40 PM, Alexander Jung wrote:
> From: Alexander Jung <alexander.jung@xxxxxxxxx>
> 
> This series introduces a port of FreeBSD's buf_ring.{h,c} implementation for 
> use
> within Unikraft.  This simple ring buffer can be used for message passing in
> queues, for example within a AF_UNIX socket implementation between two 
> threads.  The implementation is therefore thread safe and provides a generic 
> data field which is initialized to the desired ring buffer length.
> 
> The implementation is provided within ukmpi as a new option, LIBUKMPI_RING, 
> which exposes the following new methods:
> 
>  - uk_ring_alloc
>  - uk_ring_free
>  - uk_ring_enqueue
>  - uk_ring_dequeue
>  - uk_ring_dequeue_single
>  - uk_ring_advance_single
>  - uk_ring_putback_single
>  - uk_ring_peek
>  - uk_ring_peek_clear_single
>  - uk_ring_full
>  - uk_ring_empty
>  - uk_ring_count
> 
> The port is currently limited, with no support for reading atomic values from
> ARM{32,64} CPU registers (described in the comments inline).  As a result, 
> use 
> of the ring buffer implementation is untested on ARM.
> 
> Alexander Jung (5):
>   lib/ukmpi: Introduce simple ring interface KConfig option
>   lib/ukmpi: Initial port of FreeBSD's buf_ring.h
>   lib/ukmpi: Provide ring buffer allocation and free methods
>   lib/ukmpi: Include ring buffer into Unikraft build process
>   lib/ukmpi: Export the global ring buffer (de)init methods
> 
>  lib/ukmpi/Config.uk         |  23 ++-
>  lib/ukmpi/Makefile.uk       |   1 +
>  lib/ukmpi/exportsyms.uk     |   3 +
>  lib/ukmpi/include/uk/ring.h | 474 
> ++++++++++++++++++++++++++++++++++++++++++++
>  lib/ukmpi/ring.c            |  87 ++++++++
>  5 files changed, 587 insertions(+), 1 deletion(-)
>  create mode 100644 lib/ukmpi/include/uk/ring.h
>  create mode 100644 lib/ukmpi/ring.c
> 



 


Rackspace

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