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

Re: [UNIKRAFT PATCH] lib/ukboot: Provide option to initialize TLSF



Hi Simon, looks good to me!

Something that could be done while upstreaming (but it's okay otherwise) is
to add a help entry to the Config.uk TLSF option (inline).

Reviewed-by: Hugo Lefeuvre <hugo.lefeuvre@xxxxxxxxxxxxxxxx>

On Mon, Oct 19, 2020 at 12:17:27PM +0200, Simon Kuenzer wrote:
> Provides the option to initialize TLSF as allocator. The option is only made
> available when `LIBTLSF_INCLUDED` is set. This should be done by the TLSF
> library as soon included to Unikraft. It is expected that this solution
> intermediate until we are able to dynamically register configuration options 
> to
> core libraries.
> 
> Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
> ---
>  lib/ukboot/Config.uk | 5 +++++
>  lib/ukboot/boot.c    | 4 ++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/lib/ukboot/Config.uk b/lib/ukboot/Config.uk
> index 57cf1e36..9e2996d7 100644
> --- a/lib/ukboot/Config.uk
> +++ b/lib/ukboot/Config.uk
> @@ -92,6 +92,11 @@ if LIBUKBOOT
>                 Satisfy allocation as fast as possible. No support for free().
>                 Refer to help in ukallocregion for more information.
>  
> +             config LIBUKBOOT_INITTLSF
> +             bool "TLSF"
> +             depends on LIBTLSF_INCLUDED
> +             select LIBTLSF

+      help
+        Real-time allocator. Bounded fragmentation, allocation, and
+        deallocation.

> +
>               config LIBUKBOOT_NOALLOC
>               bool "None"
>  
> diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
> index a4e12bf7..2f7ab24a 100644
> --- a/lib/ukboot/boot.c
> +++ b/lib/ukboot/boot.c
> @@ -45,6 +45,8 @@
>  #include <uk/allocbbuddy.h>
>  #elif CONFIG_LIBUKBOOT_INITREGION
>  #include <uk/allocregion.h>
> +#elif CONFIG_LIBUKBOOT_INITTLSF
> +#include <uk/tlsf.h>
>  #endif
>  #if CONFIG_LIBUKSCHED
>  #include <uk/sched.h>
> @@ -239,6 +241,8 @@ void ukplat_entry(int argc, char *argv[])
>                       a = uk_allocbbuddy_init(md.base, md.len);
>  #elif CONFIG_LIBUKBOOT_INITREGION
>                       a = uk_allocregion_init(md.base, md.len);
> +#elif CONFIG_LIBUKBOOT_INITTLSF
> +                     a = uk_tlsf_init(md.base, md.len);
>  #endif
>               } else {
>                       uk_alloc_addmem(a, md.base, md.len);
> -- 
> 2.20.1
> 
> 

-- 
                Hugo Lefeuvre (hle)    |    www.owl.eu.com
RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD
ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C

Attachment: signature.asc
Description: PGP signature


 


Rackspace

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