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

Re: [UNIKRAFT PATCH,v2,00/15] Introduce Ring Buffer Implementation



Hi Alexander,

This is not what I had in mind when I commented for the v1, but in the
end I think it's much better this way because it gives way to a more
precise reviewing.

It is necessary to have this implementation imported as good as possible
because the ring buffer is an important abstraction used for performance
and is very sensitive to changes. We needed this in Unikraft for quite
some time and there are many other libraries that need it. For example
we can use it to improve the pipe() implementation.

My reviewing for this v2 is completed. Those patches to which I didn't
comment anything are fine, but I can't sign them yet because I expect
those to be changed for next versions.

Cheers,
Costin

On 7/21/20 6:39 PM, Alexander Jung wrote:
> 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 (15):
>   lib/ukring: Import simple ring buffer from FreeBSD
>   lib/ukring: {ring.c, ring.h} Fix checkpatch errors and spacing.
>   lib/ukring: Adapt {ring.c, ring.h} to Unikraft
>   lib/ukring: Re-prefix methods and structs from buf_ to uk_
>   lib/ukring: Remove br_ prefix and rename br variable
>   lib/ukring: Disable use of cpu_spinwait function
>   lib/ukring: Rename single and multiple consumer functions.
>   lib/ukring: Use Unikraft to enable ring buffer debugging
>   lib/ukring: Remove unsupported cache line size
>   lib/ukring: Disable use of CPU prefetching
>   lib/ukring: Properly commment {ring.c, ring.h}
>   lib/ukring: Provide KConfig menu option for microlibrary
>   lib/ukring: Target files to build for the microlibrary
>   lib/ukring: Register ukring with Unikraft
>   lib/ukring: Fix unitialized variable
> 
>  lib/Makefile.uk              |   1 +
>  lib/ukring/Config.uk         |   7 +
>  lib/ukring/Makefile.uk       |   6 +
>  lib/ukring/exportsyms.uk     |  12 +
>  lib/ukring/include/uk/ring.h | 482 +++++++++++++++++++++++++++++++++++
>  lib/ukring/ring.c            |  86 +++++++
>  6 files changed, 594 insertions(+)
>  create mode 100644 lib/ukring/Config.uk
>  create mode 100644 lib/ukring/Makefile.uk
>  create mode 100644 lib/ukring/exportsyms.uk
>  create mode 100644 lib/ukring/include/uk/ring.h
>  create mode 100644 lib/ukring/ring.c
> 



 


Rackspace

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