Page MenuHomeFreeBSD

D44455.diff
No OneTemporary

D44455.diff

diff --git a/sys/conf/options b/sys/conf/options
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -638,6 +638,7 @@
EARLY_AP_STARTUP opt_global.h
SMP opt_global.h
NUMA opt_global.h
+HMP opt_global.h
# Size of the kernel message buffer
MSGBUF_SIZE opt_msgbuf.h
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -49,6 +49,7 @@
#include <machine/smp.h>
#include "opt_sched.h"
+#include "opt_global.h"
MALLOC_DEFINE(M_TOPO, "toponodes", "SMP topology data");
@@ -81,7 +82,9 @@
top->cg_children = 0;
top->cg_level = CG_SHARE_NONE;
top->cg_flags = 0;
-
+#if defined(HMP)
+ memset(top->cg_score, CG_SCORE_DEFAULT, sizeof(top->cg_score));
+#endif
return (top);
}
@@ -781,6 +784,9 @@
child->cg_count = count;
child->cg_flags = flags;
child->cg_mask = mask;
+#if defined(HMP)
+ memset(child->cg_score, CG_SCORE_DEFAULT, sizeof(child->cg_score));
+#endif
parent->cg_children++;
for (; parent != NULL; parent = parent->cg_parent) {
if (CPU_OVERLAP(&parent->cg_mask, &child->cg_mask))
diff --git a/sys/sys/smp.h b/sys/sys/smp.h
--- a/sys/sys/smp.h
+++ b/sys/sys/smp.h
@@ -20,6 +20,8 @@
#include <sys/cpuset.h>
#include <sys/queue.h>
+#include "opt_global.h"
+
/*
* Types of nodes in the topological tree.
*/
@@ -75,6 +77,13 @@
* The topology may be omitted by systems where all CPUs are equal.
*/
+#if defined(HMP)
+#define CG_SCORE_CLASS_MAX 8
+#define CG_SCORE_CAPABILITY_MAX 2
+
+#define CG_SCORE_DEFAULT 0x80
+#endif
+
struct cpu_group {
struct cpu_group *cg_parent; /* Our parent group. */
struct cpu_group *cg_child; /* Optional children groups. */
@@ -85,6 +94,10 @@
int16_t cg_children; /* Number of children groups. */
int8_t cg_level; /* Shared cache level. */
int8_t cg_flags; /* Traversal modifiers. */
+#if defined(HMP)
+ uint8_t cg_score[CG_SCORE_CLASS_MAX][CG_SCORE_CAPABILITY_MAX];
+ /* Performance/Efficiency Score from Intel HFI/ITD */
+#endif
};
typedef struct cpu_group *cpu_group_t;
diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c
--- a/sys/x86/x86/mp_x86.c
+++ b/sys/x86/x86/mp_x86.c
@@ -37,6 +37,7 @@
#include "opt_sched.h"
#include "opt_smp.h"
#include "opt_stack.h"
+#include "opt_global.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -850,6 +851,13 @@
else
cg_root->cg_flags = 0;
+#if defined(HMP)
+ /*
+ * Set default performance/efficiency score.
+ */
+ memset(cg_root->cg_score, CG_SCORE_DEFAULT, sizeof(cg_root->cg_score));
+#endif
+
/*
* Check how many core nodes we have under the given root node.
* If we have multiple logical processors, but not multiple

File Metadata

Mime Type
text/plain
Expires
Fri, Jun 19, 2:59 PM (21 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34086543
Default Alt Text
D44455.diff (2 KB)

Event Timeline