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

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


  • To: Costin Lupu <costin.lupu@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: "Jung, Alexander" <a.jung@xxxxxxxxxxxxxxx>
  • Date: Mon, 20 Jul 2020 21:52:32 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=lancaster.ac.uk; dmarc=pass action=none header.from=lancaster.ac.uk; dkim=pass header.d=lancaster.ac.uk; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j9bvtIRSM4YYyQp2ZdrOyrd8YvRgIoYhIhWZauaO0/4=; b=KghzABipxnp/nt+FCXzSneTFcPNCoOoWj2FdXEIHKWDhiYClpLIB9wYpiTK9cyNNOKiB96BsM+vgkPH8OiqNfZuMx0gX1cdGUq+Mekz1OOFW1BucuYup2aMocenSoJDjbBKfR+mE83k6S17S+z+Zmzbpq9uSk1jHPDkkALff0Ja4uKPpjLNt23It6mbQ70xUlwMxzJXvuAt4fnJrFhuGv5UFnNhaMHfjsBeIkW05c94yu/5QIpYaSRg+2Ui9xs1u/d3y4o2nlEfXXzENupiyOuXaunRaY815QSisxKEPbJ5IK+I5cQkuOrQylGqSrggvvoy/UTro+D6cwEuiV8tPog==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SQVP4WaPMqVM3oT0qb3151Ja3Clwrh5uC2nHLumX4q0npHDQfLB0StQfFvmrpI60Iuy8yAjZuyYFYhQmsUqPH4r5UBZZL/4P8MEnHwrtGSBE2PqDIQIlPn4wJqGNizTocSWwRRCJ/3VFzfYMkOqt53KKzrEn05uplFUjFh8Chig/iYs7j+Xi2cR0sVX7j5ukF1w00vpa4l+ZS67uvIWBdfsifonQDrEgcnwdCe3QzJawJK2qQ4vVoINpvQDENGAX2YhlfToZART3jLcK1hlmzBQyfKqDcOvPXpEdZBMYONuVX9ukzU3mklYourtscIaJ4V6N8w6W0Ox/nqWisk/GVw==
  • Authentication-results: cs.pub.ro; dkim=none (message not signed) header.d=none;cs.pub.ro; dmarc=none action=none header.from=lancaster.ac.uk;
  • Cc: Felipe Huici <felipe.huici@xxxxxxxxx>, Simon Kuenzer <simon.kuenzer@xxxxxxxxx>, Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
  • Delivery-date: Mon, 20 Jul 2020 21:52:39 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHWXuARYZSBEwYhh0KI3dB0dDXIIQ==
  • Thread-topic: [UNIKRAFT PATCH 0/5] Introduce Ring Buffer Implementation

Hi Costin,

For this version, I simply chose to introduce it into the ukmpi library since 
it adopts a similar trait to mbox, which is the current inhabitant of the 
microlibrary.  Mbox is another "simple message passing" implementation and, for 
me, along with the offline conversation I had with Simon (cc'd), it made sense 
to include it here as an additional provision of the microlibrary itself.  

I think your argument is fair in that it can exist as its own library: simply 
as `ukring`.  At this point, it is simple a decision w.r.t. whether the library 
constitutes creating enough additional options that would degrade the quality 
of ukmpi itself.  Particulary, you refer to additional options which will be 
brought out of the implementation in the future.  For now, I do not see 
additional options which would surface themselves at present in the KConfig 
option menu.  The decision is ultimately whether these options arise from 
implementation-specific requirements, in the case of, for instance, mp_ring.{c,
h} from FreeBSD which is the ring buffer implementation for the networking 
stack (that it is to say, "would this be part of `ukring` or it's own library?")

One thing to note is that the ring implementation, along with mbox, are not 
POSIX, and so mbox and ring's "exportsyms" do not share similar method 
standardization.  This, along with the fact that they are 
Unikraft-centric/-core 
and namespaced functions mean as internal communication mechanism its placement 
is somewhat arbitrary.

What do you think?

Thanks,

Alexander


On 20.07.20, 22:55, "Minios-devel on behalf of Costin Lupu" 
<minios-devel-bounces@xxxxxxxxxxxxxxxxxxxx on behalf of costin.lupu@xxxxxxxxx> 
wrote:

    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®.