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

Re: [Minios-devel] [UNIKRAFT/PTHREAD-EMBEDDED PATCH 1/1] Set highest priority to pthread constructor


  • To: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>, Costin Lupu <costin.lupu@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Date: Thu, 28 Nov 2019 11:23:50 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stud.acs.upb.ro; dmarc=pass action=none header.from=stud.acs.upb.ro; dkim=pass header.d=stud.acs.upb.ro; 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=wHKdff8OTZr7JTvAE0+ARV0rMMike5Pva6XqljN4DPo=; b=E6ulm5aBOrnaBfJeUoYVnP7a+VbGxPdMlatQfkT2mqNOlpGN/umR8hoyEWktB7P1iImS6exGdV9bNoOFsn/2EgC1nheLdaGxoY50YMRxAVC2B6QMMgg2TP6aBQPlpdBv4+6dFS6SPbBneBQqmRrSUGZxoe+jMIyKN26mu8u855plUVoK3uC4TXzFUqWXZH1GhdNUS4JtQQIuEyLLFiu8v8FDb/+vTnYCcRjldZrUTwLm+WRrJipoi8bFsZga+3rGHRjUIKVKMrIM7W5bt3Pv9xINFindWoOBqlF+N34eML/lxchzTJXCya7pEY0FIR9diHABUlFL3z4shLgXOmPfvw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JLHLD2e4vwqABwqeCoF8Em0ZDX5wUGmEOqeiXbSXW4Mz9wJd/yyg8aHjIq2s+IDilYb8maUIDVh+DyDrXnN0oKL7PHd5h2Ku4PmhqQ2RYvC001KSvM3zSpQWEq81Qnj9U75ZWHgFpIJVulyE4pyhboKaWGyAYBXEKpwtj2DHv3wVCmf4zeBqOlSm6ESMLJwbyw6M9hQzrgElod6FHDaz7ngDH+kH/PEpiRedIyPuGH0WtGF9UBRRUR7bQkW6YkbtdjiKBTr0Egzo5iDUaWumv1cB1n0LQ/p7OXALyK5H6sPp9Szqk7q7LggRPtWuPDyHD7nKV7ebkXT+pLxO3Xr6Tg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Delivery-date: Thu, 28 Nov 2019 11:34:00 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVj3KujqbqFO1gg06UbDvaNigZH6d148KAgBAsHICAAAdNgIAYx+gAgAG+o4A=
  • Thread-topic: [Minios-devel] [UNIKRAFT/PTHREAD-EMBEDDED PATCH 1/1] Set highest priority to pthread constructor

Hey Simon,

I had a discussion with Costin on this topic before reviewing the patch 
and commenting on it being a temporal fix. Using another class of 
constructors for pthread would not solve the underlying problem. In this 
case, we presume that there exists at least one other library that needs 
to be initiated before pthreads; We end up with the same issue. In my 
opinion, a way to solve this would be to add an order operator for 
constructors. Let me know what you think.

Thanks,

Vlad

On 27.11.2019 10:45, Simon Kuenzer wrote:
> Any comments?
>
> Thanks,
>
> Simon
>
> On 11.11.19 15:19, Simon Kuenzer wrote:
>> Oh sorry, these questions are actually going to the related patch of 
>> to Unikraft's main repository that introduces /include/uk/ctors_prio.h:
>>   GIT d56a47c2d
>>   Patchwork https://patchwork.unikraft.org/patch/736664/
>>
>> I understand that this is supposed to be a temporary fix. I just 
>> wonder what was missing on the existing code base to make the 
>> temporary solution work. I see pthread_embedded as a basic system 
>> lib, so it would be fine to use the system constructors or the 
>> inittable depending when the functionality has to be initialized. 
>> Both of them are called before the application constructors are called.
>>
>> Thanks,
>>
>> Simon
>>
>> On 11.11.19 14:53, Simon Kuenzer wrote:
>>> Hey guys,
>>>
>>> I noticed that this patch went in already, however, I still have a 
>>> few questions to this:
>>>
>>> * Why isn't the content of uk/ctors_prio.h defined in ctors.h? We 
>>> also have already a constructor attribute helper with priority level 
>>> in essentials.h...
>>> * Why is needed to define a priority level of an external library in 
>>> the Unikraft repo?
>>> * And isn't 101, too late? Shouldn't the call go into the uk_ctortab 
>>> (before sched and allocator) or uk_inittab (after sched and 
>>> allocator but before application constructors -> e.g., 
>>> uk_lib_initcall)?
>>>
>>> Thanks,
>>>
>>> Simon
>>>
>>> On 01.11.19 07:55, Costin Lupu wrote:
>>>> Hi Vlad,
>>>>
>>>> I will replace 101 with UK_CTOR_PRIO_PTHREAD_EMBEDDED on upstreaming.
>>>>
>>>> Thanks,
>>>> Costin
>>>>
>>>> Reviewed-by: Costin Lupu <costin.lupu@xxxxxxxxx>
>>>>
>>>> On 10/31/19 12:37 AM, Vlad-Andrei BĂDOIU (78692) wrote:
>>>>> Other libraries might use the default constructor attribute and 
>>>>> expect pthreads
>>>>> to be initialised. We set the highest priority(101) to the pthread 
>>>>> constructor.
>>>>>
>>>>> Signed-off-by: Vlad-Andrei Badoiu 
>>>>> <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
>>>>> ---
>>>>>   pte_osal.c | 2 +-
>>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/pte_osal.c b/pte_osal.c
>>>>> index 23dcd01..df24bed 100644
>>>>> --- a/pte_osal.c
>>>>> +++ b/pte_osal.c
>>>>> @@ -58,7 +58,7 @@ typedef struct {
>>>>>    *
>>>>> ***************************************************************************/
>>>>>  
>>>>>
>>>>> -int __constructor pthread_constructor(void)
>>>>> +int __attribute__((constructor(101))) pthread_constructor(void)
>>>>>   {
>>>>>       uk_pr_debug("pthread-embedded constructor\n");
>>>>>       return pthread_init();
>>>>>
>>>>
>>>> _______________________________________________
>>>> Minios-devel mailing list
>>>> Minios-devel@xxxxxxxxxxxxxxxxxxxx
>>>> https://lists.xenproject.org/mailman/listinfo/minios-devel
>>>>
>>>
>>> _______________________________________________
>>> Minios-devel mailing list
>>> Minios-devel@xxxxxxxxxxxxxxxxxxxx
>>> https://lists.xenproject.org/mailman/listinfo/minios-devel
>>
>> _______________________________________________
>> Minios-devel mailing list
>> Minios-devel@xxxxxxxxxxxxxxxxxxxx
>> https://lists.xenproject.org/mailman/listinfo/minios-devel
_______________________________________________
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®.