lkml.org 
[lkml]   [2023]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 21/27] gunyah: vm_mgr: Add framework to add VM Functions
* Srivatsa Vaddagiri <quic_svaddagi@quicinc.com> [2023-02-03 15:07:14]:

> * Elliot Berman <quic_eberman@quicinc.com> [2023-01-20 14:46:20]:
>
> > +static struct gunyah_vm_function_driver *__find_function(const char name[GUNYAH_FUNCTION_NAME_SIZE])
> > + __must_hold(functions_lock)
> > +{
> > + struct gunyah_vm_function_driver *iter, *drv = NULL;
> > +
> > + list_for_each_entry(iter, &functions, list) {
> > + if (!strncmp(iter->name, name, GUNYAH_FUNCTION_NAME_SIZE)) {
> > + drv = iter;
> > + break;
> > + }
> > + }
>
> Not sure how much of a hot path this is going to sit in. I can imagine VM boot
> to be in fast path for some cases (VMs spawned on usecase boundaries - I think
> some VMs like in Amazon firecracker boot in fraction of a second). This
> indirection could cost that a bit (linear search + strcmp for the right
> function). IMHO a direct interface (ex: ADD_IOEVENTFD) will be more efficient.

At the minimum, I think you can make iter->name an enum, which will make the
search faster.

-vatsa

\
 
 \ /
  Last update: 2023-03-27 00:09    [W:0.152 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site