Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit a7ee297

Browse files
author
Stephanie Labasan
committed
Adding patch to fix #14. On a hyperthreaded system without the patch,
libmsr returns identical values for each socket. Signed-off-by: Stephanie Labasan <[email protected]>
1 parent b3be5d6 commit a7ee297

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ include/master.h
4242
install_manifest.txt
4343
lib/
4444
libmsr-config.cmake
45+
msrmod/msrmod
4546
mpi_test
4647
pebs
4748
platform_headers/master.h
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From f9ba57ff3fd14ce0a8708e45bd0d973aedc3e4f6 Mon Sep 17 00:00:00 2001
2+
From: Stephanie Labasan <[email protected]>
3+
Date: Tue, 3 Jan 2017 12:08:12 -0800
4+
Subject: [PATCH] Manually setting threadsPerCore to 1 to bypass duplicate
5+
readings across sockets in a hyperthreaded environment.
6+
7+
Signed-off-by: Stephanie Labasan <[email protected]>
8+
---
9+
src/msr_core.c | 1 +
10+
1 file changed, 1 insertion(+)
11+
12+
diff --git a/src/msr_core.c b/src/msr_core.c
13+
index 873dda9..83060d3 100644
14+
--- a/src/msr_core.c
15+
+++ b/src/msr_core.c
16+
@@ -798,6 +798,7 @@ int load_socket_batch(off_t msr, uint64_t **val, int batchnum)
17+
#endif
18+
if (CPU_DEV_VER == 1)
19+
{
20+
+ threadsPerCore = 1;
21+
for (dev_idx = 0, val_idx = 0; dev_idx < NUM_DEVS; dev_idx += coresPerSocket * threadsPerCore, val_idx++)
22+
{
23+
create_batch_op(msr, dev_idx, &val[val_idx], batchnum);
24+
--
25+
2.8.3
26+

0 commit comments

Comments
 (0)