RFR: 8148987: [Linux] Allow building on older systems without CPU_ALLOC support

David Holmes david.holmes at oracle.com
Fri Feb 5 12:21:26 UTC 2016


Hi Dmitry,

Thanks for looking at this.

On 5/02/2016 8:46 PM, Dmitry Samersoff wrote:
> David,
>
> I suspect that if the os don't have CPU_COUNT it doesn't have
> CPU_COUNT_S as well at 4851

It is true that if you don't have CPU_COUNT you won't have the *_S 
macros either but I'm handling the two separately as you can have 
CPU_COUNT but not CPU_ALLOC. The *_S variants were added for the dynamic 
cpu set management, so it is determined by the existence of CPU_ALLOC.

> Is it possible to create two different version of
> os::active_processor_count() - simple one for old systems and more
> complicated one for modern linux and move define to a function level?

There are really three variants:
- no CPU_COUNT or CPU_ALLOC (and *_S)
- no CPU_ALLOC (and *_S)
- everything present

There are numerous different ways in which to represent that. I started 
with the has-everything version and tried to minimize the ifdefs within 
that code by isolating the CPU_ALLOC part. Then the CPU_COUNT part is 
handled separately.

Thanks,
David

> -Dmitry
>
> On 2016-02-05 10:50, David Holmes wrote:
>> bug: https://bugs.openjdk.java.net/browse/JDK-8148987
>>
>> webrev: http://cr.openjdk.java.net/~dholmes/8148987/webrev/
>>
>> This is a tentative RFR as I'm not yet convinced we should support
>> building on these older platforms in JDK 9. Opinions welcome on that point.
>>
>> The older systems do not have dynamic cpu set support (CPU_ALLOC) nor do
>> they have the CPU_COUNT utility macro.
>>
>> Thanks,
>> David
>
>


More information about the hotspot-runtime-dev mailing list