Skip to content

Commit

Permalink
when preferred_many is not supported, fall back to preferred will
Browse files Browse the repository at this point in the history
report error.

we fix it as printed, fall back to preferred and select first node
of the node bitmask.
  • Loading branch information
luochenglcs authored and andikleen committed Sep 23, 2022
1 parent 04da3af commit 86edd38
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libnuma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1861,9 +1861,14 @@ int numa_has_preferred_many(void)

void numa_set_preferred_many(struct bitmask *bitmask)
{
int first_node = 0;

if (!has_preferred_many) {
numa_error("Unable to handle MANY preferred nodes. Falling back to first node\n");
__numa_set_preferred(bitmask);
numa_warn(W_nodeparse,
"Unable to handle MANY preferred nodes. Falling back to first node\n");
first_node = numa_find_first(bitmask);
numa_set_preferred(first_node);
return;
}
setpol(MPOL_PREFERRED_MANY, bitmask);
}
Expand Down

0 comments on commit 86edd38

Please sign in to comment.