Fix /proc/cpuinfo topology and cache size info

* autoload.cc (GetLogicalProcessorInformationEx): Import.
        (SetThreadGroupAffinity): Import.
        * fhandler_proc.cc (add_size): New macro.
        (get_msb): New inline function.
        (mask_bits): Ditto.
        (format_proc_cpuinfo): Drop handling of old CPUs.  Check if we're
        running on a OS version supporting porcessor groups.  If so, use
        SetThreadGroupAffinity to set thread affinity.  Improve cache info
        to include 3rd level cache on Intel CPUs.  Improve multi core info.
        * wincap.h (wincaps::has_processor_groups): New element.
        * wincap.cc: Implement above element throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2015-08-13 17:59:47 +02:00
parent 1e15b46737
commit e0d48debed
6 changed files with 639 additions and 511 deletions

View File

@ -42,6 +42,7 @@ struct wincaps
unsigned has_microsoft_accounts : 1;
unsigned has_set_thread_stack_guarantee : 1;
unsigned has_broken_rtl_query_process_debug_information : 1;
unsigned has_processor_groups : 1;
};
class wincapc
@ -98,6 +99,7 @@ public:
bool IMPLEMENT (has_microsoft_accounts)
bool IMPLEMENT (has_set_thread_stack_guarantee)
bool IMPLEMENT (has_broken_rtl_query_process_debug_information)
bool IMPLEMENT (has_processor_groups)
#undef IMPLEMENT
};