Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3f8587cb
Commit
3f8587cb
authored
Aug 10, 2023
by
Hans de Goede
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'intel-speed-select/intel-sst' into review-hans
parents
e3205d41
2fff509a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
4 deletions
+51
-4
tools/power/x86/intel-speed-select/isst-config.c
tools/power/x86/intel-speed-select/isst-config.c
+49
-2
tools/power/x86/intel-speed-select/isst-display.c
tools/power/x86/intel-speed-select/isst-display.c
+1
-1
tools/power/x86/intel-speed-select/isst.h
tools/power/x86/intel-speed-select/isst.h
+1
-1
No files found.
tools/power/x86/intel-speed-select/isst-config.c
View file @
3f8587cb
...
...
@@ -5,6 +5,7 @@
*/
#include <linux/isst_if.h>
#include <sys/utsname.h>
#include "isst.h"
...
...
@@ -15,7 +16,7 @@ struct process_cmd_struct {
int
arg
;
};
static
const
char
*
version_str
=
"v1.1
6
"
;
static
const
char
*
version_str
=
"v1.1
7
"
;
static
const
int
supported_api_ver
=
2
;
static
struct
isst_if_platform_info
isst_platform_info
;
...
...
@@ -473,11 +474,44 @@ static unsigned int is_cpu_online(int cpu)
return
online
;
}
static
int
get_kernel_version
(
int
*
major
,
int
*
minor
)
{
struct
utsname
buf
;
int
ret
;
ret
=
uname
(
&
buf
);
if
(
ret
)
return
ret
;
ret
=
sscanf
(
buf
.
release
,
"%d.%d"
,
major
,
minor
);
if
(
ret
!=
2
)
return
ret
;
return
0
;
}
#define CPU0_HOTPLUG_DEPRECATE_MAJOR_VER 6
#define CPU0_HOTPLUG_DEPRECATE_MINOR_VER 5
void
set_cpu_online_offline
(
int
cpu
,
int
state
)
{
char
buffer
[
128
];
int
fd
,
ret
;
if
(
!
cpu
)
{
int
major
,
minor
;
ret
=
get_kernel_version
(
&
major
,
&
minor
);
if
(
!
ret
)
{
if
(
major
>
CPU0_HOTPLUG_DEPRECATE_MAJOR_VER
||
(
major
==
CPU0_HOTPLUG_DEPRECATE_MAJOR_VER
&&
minor
>=
CPU0_HOTPLUG_DEPRECATE_MINOR_VER
))
{
debug_printf
(
"Ignore CPU 0 offline/online for kernel version >= %d.%d
\n
"
,
major
,
minor
);
debug_printf
(
"Use cgroups to isolate CPU 0
\n
"
);
return
;
}
}
}
snprintf
(
buffer
,
sizeof
(
buffer
),
"/sys/devices/system/cpu/cpu%d/online"
,
cpu
);
...
...
@@ -778,6 +812,7 @@ static void create_cpu_map(void)
map
.
cpu_map
[
0
].
logical_cpu
);
}
else
{
update_punit_cpu_info
(
map
.
cpu_map
[
0
].
physical_cpu
,
&
cpu_map
[
i
]);
punit_id
=
cpu_map
[
i
].
punit_id
;
}
}
cpu_map
[
i
].
initialized
=
1
;
...
...
@@ -2621,10 +2656,11 @@ static struct process_cmd_struct isst_cmds[] = {
*/
void
parse_cpu_command
(
char
*
optarg
)
{
unsigned
int
start
,
end
;
unsigned
int
start
,
end
,
invalid_count
;
char
*
next
;
next
=
optarg
;
invalid_count
=
0
;
while
(
next
&&
*
next
)
{
if
(
*
next
==
'-'
)
/* no negative cpu numbers */
...
...
@@ -2634,6 +2670,8 @@ void parse_cpu_command(char *optarg)
if
(
max_target_cpus
<
MAX_CPUS_IN_ONE_REQ
)
target_cpus
[
max_target_cpus
++
]
=
start
;
else
invalid_count
=
1
;
if
(
*
next
==
'\0'
)
break
;
...
...
@@ -2660,6 +2698,8 @@ void parse_cpu_command(char *optarg)
while
(
++
start
<=
end
)
{
if
(
max_target_cpus
<
MAX_CPUS_IN_ONE_REQ
)
target_cpus
[
max_target_cpus
++
]
=
start
;
else
invalid_count
=
1
;
}
if
(
*
next
==
','
)
...
...
@@ -2668,6 +2708,13 @@ void parse_cpu_command(char *optarg)
goto
error
;
}
if
(
invalid_count
)
{
isst_ctdp_display_information_start
(
outf
);
isst_display_error_info_message
(
1
,
"Too many CPUs in one request: max is"
,
1
,
MAX_CPUS_IN_ONE_REQ
-
1
);
isst_ctdp_display_information_end
(
outf
);
exit
(
-
1
);
}
#ifdef DEBUG
{
int
i
;
...
...
tools/power/x86/intel-speed-select/isst-display.c
View file @
3f8587cb
...
...
@@ -442,7 +442,7 @@ void isst_ctdp_display_information(struct isst_id *id, FILE *outf, int tdp_level
}
if
(
ctdp_level
->
mem_freq
)
{
snprintf
(
header
,
sizeof
(
header
),
"mem-frequency(MHz)"
);
snprintf
(
header
,
sizeof
(
header
),
"m
ax-m
em-frequency(MHz)"
);
snprintf
(
value
,
sizeof
(
value
),
"%d"
,
ctdp_level
->
mem_freq
);
format_and_print
(
outf
,
level
+
2
,
header
,
value
);
...
...
tools/power/x86/intel-speed-select/isst.h
View file @
3f8587cb
...
...
@@ -79,7 +79,7 @@
#define DISP_FREQ_MULTIPLIER 100
#define MAX_PACKAGE_COUNT
8
#define MAX_PACKAGE_COUNT
32
#define MAX_DIE_PER_PACKAGE 2
#define MAX_PUNIT_PER_DIE 8
...
...
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