Skip to content

Commit

Permalink
lib: Fix MBR value for non-SNC machines
Browse files Browse the repository at this point in the history
There is an issue in counting remote traffic for non-SNC machines,
it is always 0.
Example: There is a 2-socket non-SNC machine having the following CPU
mapping:
NUMA node0 CPU(s):               0-47,96-143
NUMA node1 CPU(s):               48-95,144-191

Let's generate remote traffic in a terminal 1:
1. From node 0 to node 1
numactl --membind=1 membw -c 1 -b 200 --write
2. From node 1 to node 0
numactl --membind=0 membw -c 49 -b 200 --write
Let's check 'MBR' value for each of the cases in a terminal 2:
$ sudo LD_LIBRARY_PATH=lib ./pqos/pqos --iface=os -m
"llc:1,49;mbl:1,49;mbr:1,49;mbt:1,49"

It will show that MBR is always zero. This is wrong.

Remove the wrong calculation that doesn't affect the results for SNC
machines and zeroes MBR values for non-SNC ones.

Signed-off-by: Roman Storozhenko <[email protected]>
  • Loading branch information
rstorozh authored and rkanagar committed Jul 12, 2024
1 parent 1d30d47 commit 8c3b1c9
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ pqos_mon_poll_events(struct pqos_mon_data *group)
* Calculate values of virtual events
*/
if (group->event & PQOS_MON_EVENT_RMEM_BW) {
const struct pqos_capability *cap_mon =
_pqos_cap_get_type(PQOS_CAP_TYPE_MON);
const struct pqos_cap *cap = _pqos_get_cap();
const struct pqos_monitor *pmon;
uint64_t max_value = 0;
Expand All @@ -214,10 +212,6 @@ pqos_mon_poll_events(struct pqos_mon_data *group)
group->values.mbm_total_delta -
group->values.mbm_local_delta;

if (cap_mon->u.mon->snc_mode == PQOS_SNC_LOCAL)
group->values.mbm_remote_delta *=
cap_mon->u.mon->snc_num;

ret = pqos_cap_get_event(cap, PQOS_MON_EVENT_RMEM_BW, &pmon);
if (ret == PQOS_RETVAL_OK)
max_value = 1LLU << pmon->counter_length;
Expand Down

0 comments on commit 8c3b1c9

Please sign in to comment.