On Sunday 10 October 2010 00:26:45 you wrote: > On 10/09/2010 12:37 PM, Rudolf Mayerhofer wrote: > >>> +static SYSTEM_LOGICAL_PROCESSOR_INFORMATION cached_lpi[1024]; > >> > >> You think there are systems with that many CPUs running Wine? > > > > I honestly don't know the array is currently large enough to support > > 146 CPU's with 4 unique Caches (L1i,L1d,L2,L3), each in it's own > > processorpackage and numa node. This might be a bit of an overkill, > > any suggestions how many cpu's are used with wine in the worst case? > > Then you probably want to allocate it from the heap instead of creating a > static array. >
I haven't found out how to do this properly yet and i think that i definitely need help on that one (like an example) as my skills in C are not that good and all i manage to get when trying to allocate the stuff from the heap is a segfault. For the time being i reduced the arraysize to 896, which should still be large enough to support 128 CPUs in SysFS in the worst case. > >> People already asked you not to do this. From looking at the code it > >> appears that there is always one node. So get rid of everything except > >> do{} while() block. It will do exactly what you want with extra if()s. > > > > This assumption is definitely wrong, on non-numa systems there is no node > > definition in SysFS. Windows on the same system shows one node and MSDN > > also hints that there should be a dummy node with number 0 and a > > processormask containing all known processors on the system in that > > case. > > I'm not talking about the content of the SysFS. I'm talking about what your > code does. If you remove that "if{} else{}" part and keep > "do{} while();" part as-is you will get exactly the same result. I figured that one out, although it took me a while.