This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 1/3] Tunables: Add tunables of spin count for pthread adaptive spin mutex
- From: kemi <kemi dot wang at intel dot com>
- To: Florian Weimer <fweimer at redhat dot com>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Rical Jason <rj at 2c3t dot io>, Carlos Donell <carlos at redhat dot com>, Glibc alpha <libc-alpha at sourceware dot org>
- Cc: Dave Hansen <dave dot hansen at linux dot intel dot com>, Tim Chen <tim dot c dot chen at intel dot com>, Andi Kleen <andi dot kleen at intel dot com>, Ying Huang <ying dot huang at intel dot com>, Aaron Lu <aaron dot lu at intel dot com>, Lu Aubrey <aubrey dot li at intel dot com>
- Date: Thu, 14 Jun 2018 09:36:39 +0800
- Subject: Re: [PATCH v3 1/3] Tunables: Add tunables of spin count for pthread adaptive spin mutex
- References: <1527067354-13333-1-git-send-email-kemi.wang@intel.com> <c6572206-91cb-3d6e-5952-63cbd1a0ea9c@redhat.com> <86be6ce2-e728-e084-eeda-aeaf3a4b45b7@intel.com> <5d49a64c-66b6-dd6f-c892-a9274b5c9efd@redhat.com>
On 2018年06月08日 22:54, Florian Weimer wrote:
> On 06/08/2018 09:57 AM, kemi wrote:
>>
>>
>> On 2018年06月07日 21:09, Florian Weimer wrote:
>>> On 05/23/2018 11:22 AM, Kemi Wang wrote:
>>>> +#ifdef SHARED
>>>> +# define INIT_SECTION ".init_array"
>>>> +#else
>>>> +# define INIT_SECTION ".preinit_array"
>>>> +#endif
>>>> +
>>>> +void (*const __pthread_mutex_tunables_init_array []) (int, char **, char **)
>>>> + __attribute__ ((section (INIT_SECTION), aligned (sizeof (void *)))) =
>>>> +{
>>>> + &mutex_tunables_init
>>>> +};
>>>
>>>
>>> Did you try to get rid of this?
>>>
>>
>> I remembered you suggested me to put this initialization as part of pthread initialization.
>>
>> https://sourceware.org/ml/libc-alpha/2018-05/msg00289.html
>>
>> But, mutex_tunables_init need three parameters such as argc, argv, and env from libc_start_main,
>> while the pthread initialization function __pthread_initialize_minimal does not include any parameter.
>> I don't think we can simply put it as part of overall thread initialization unless we change the API
>> of __pthread_initialize_minimal.
>>
>> Maybe you have better idea.
>
> I will have a lok at it next week.
>
> We need to do this as part of the main initialization of the library, so that the tunable is stripped from the environment if necessary.
>
Do you have any idea for this issue? How about doing it as part of tunable initialization. (__tunables_init).
And could you explain a bit more on the value of this change. Thanks.
> Thanks,
> Florian