Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1312c664
Commit
1312c664
authored
Jun 20, 2018
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Jun 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Report physical cores once with proper thread mask.
Signed-off-by:
Roderick Colenbrander
<
thunderbird2k@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c6a71b91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
11 deletions
+37
-11
nt.c
dlls/ntdll/nt.c
+37
-11
No files found.
dlls/ntdll/nt.c
View file @
1312c664
...
...
@@ -1333,17 +1333,16 @@ static inline BOOL logical_proc_info_add_by_id(SYSTEM_LOGICAL_PROCESSOR_INFORMAT
if
(
pdata
)
{
DWORD
i
;
if
(
rel
==
RelationProcessorPackage
){
for
(
i
=
0
;
i
<*
len
;
i
++
)
for
(
i
=
0
;
i
<*
len
;
i
++
)
{
if
(
rel
==
RelationProcessorPackage
&&
(
*
pdata
)[
i
].
Relationship
==
rel
&&
(
*
pdata
)[
i
].
u
.
Reserved
[
1
]
==
id
)
{
if
((
*
pdata
)[
i
].
Relationship
!=
rel
||
(
*
pdata
)[
i
].
u
.
Reserved
[
1
]
!=
id
)
continue
;
(
*
pdata
)[
i
].
ProcessorMask
|=
mask
;
return
TRUE
;
}
}
else
i
=
*
len
;
else
if
(
rel
==
RelationProcessorCore
&&
(
*
pdata
)[
i
].
Relationship
==
rel
&&
(
*
pdata
)[
i
].
u
.
Reserved
[
1
]
==
id
)
return
TRUE
;
}
while
(
*
len
==
*
pmax_len
)
{
...
...
@@ -1369,6 +1368,10 @@ static inline BOOL logical_proc_info_add_by_id(SYSTEM_LOGICAL_PROCESSOR_INFORMAT
dataex
->
u
.
Processor
.
GroupMask
[
0
].
Mask
|=
mask
;
return
TRUE
;
}
else
if
(
rel
==
RelationProcessorCore
&&
dataex
->
Relationship
==
rel
&&
dataex
->
u
.
Processor
.
Reserved
[
1
]
==
id
)
{
return
TRUE
;
}
ofs
+=
dataex
->
Size
;
}
...
...
@@ -1554,6 +1557,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
for
(
i
=
beg
;
i
<=
end
;
i
++
)
{
DWORD
phys_core
=
0
;
ULONG_PTR
thread_mask
=
0
;
if
(
i
>
8
*
sizeof
(
ULONG_PTR
))
{
FIXME
(
"skipping logical processor %d
\n
"
,
i
);
...
...
@@ -1574,15 +1580,35 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
return
STATUS_NO_MEMORY
;
}
sprintf
(
name
,
core_info
,
i
,
"core_id"
);
/* Sysfs enumerates logical cores (and not physical cores), but Windows enumerates
* by physical core. Upon enumerating a logical core in sysfs, we register a physical
* core and all its logical cores. In order to not report physical cores multiple
* times, we pass a unique physical core ID to logical_proc_info_add_by_id and let
* that call figure out any duplication.
* Obtain a unique physical core ID from the first element of thread_siblings_list.
* This list provides logical cores sharing the same physical core. The IDs are based
* on kernel cpu core numbering as opposed to a hardware core ID like provided through
* 'core_id', so are suitable as a unique ID.
*/
sprintf
(
name
,
core_info
,
i
,
"thread_siblings_list"
);
f
=
fopen
(
name
,
"r"
);
if
(
f
)
{
fscanf
(
f
,
"%u"
,
&
r
);
fscanf
(
f
,
"%d%c"
,
&
phys_core
,
&
op
);
fclose
(
f
);
}
else
phys_core
=
i
;
/* Mask of logical threads sharing same physical core in kernel core numbering. */
sprintf
(
name
,
core_info
,
i
,
"thread_siblings"
);
f
=
fopen
(
name
,
"r"
);
if
(
f
)
{
fscanf
(
f
,
"%lx"
,
&
thread_mask
);
fclose
(
f
);
}
else
r
=
i
;
if
(
!
logical_proc_info_add_by_id
(
data
,
dataex
,
&
len
,
max_len
,
RelationProcessorCore
,
r
,
(
ULONG_PTR
)
1
<<
i
))
else
thread_mask
=
1
<<
i
;
if
(
!
logical_proc_info_add_by_id
(
data
,
dataex
,
&
len
,
max_len
,
RelationProcessorCore
,
phys_core
,
thread_mask
))
{
fclose
(
fcpu_list
);
return
STATUS_NO_MEMORY
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment