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

Re: [Minios-devel] [UNIKRAFT PATCH 4/8] lib/uksched: Introduce thread info



Hi Florian,

On 1/2/19 4:39 PM, Florian Schmidt wrote:
> Hi Costin,
> 
> On 9/25/18 12:09 PM, Felipe Huici wrote:
>> Hi,
>>
>>
>>> Thread behaviors can be configured by using thread attributes. For
>>> keeping this information, we introduce the thread info abstraction.
>>> Schedulers should extend this abstraction when adding custom
>>> configuration features.
>>
>> s/behaviors/behavior
>> s/For keeping/To keep
>>
>> Perhaps add a sentence or two more to explain what “extend” means, e.g.,
>> should a scheduler use thread_info_base_create or thread_info_base_init?
> 
> Yeah, I also read this and wasn't sure what exactly it means. What is an
> example where a scheduler should extend this? For example, the two
> attributes prio and timeslice that you introduced in the previous patch
> are set up so that they don't need to be kept in tib, but instead
> uk_thread_set_prio calls uk_sched_thread_set_prio, which calls the
> respective scheduler's implementation of what to do with prio and
> timeslice information.

Alright. This would be the added comments in v2:
"For example, a preemptive scheduler might define its custom info
like this:

struct thread_info_preempt {
    struct thread_info_base base;
    prio_t prio;
    ...

Similar to base constructor, the preemptive abstraction constructor
would look like this:

struct thread_info_preempt *
thread_info_preempt_create(struct uk_alloc *a,
        struct uk_thread_attr *attr)
{
    struct thread_info_preempt *tip;

    tip = uk_malloc(a, sizeof(struct thread_info_preempt));
    thread_info_base_init(&tip->base, attr); /* init base info */
    tip->prio = attr->prio;
    ...
"

Thanks,
Costin

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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