---
name: "find_next_best_node"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/find_next_best_node"
---

# find\_next\_best\_node(9)

find the next node that should appear in a given node's fallback list

## NAME

find\_next\_best\_node - find the next node that should appear in a given node's fallback list

## SYNOPSIS

**int find\_next\_best\_node(int** *node***, nodemask\_t \*** *used\_node\_mask***);**

## ARGUMENTS

*node*

node whose fallback list we're appending

*used\_node\_mask*

nodemask\_t of already used nodes

## DESCRIPTION

We use a number of factors to determine which is the next node that should appear on a given node's fallback list. The node should not have appeared already in *node*'s fallback list, and it should be the next closest node according to the distance array (which contains arbitrary distance values from each node to each node in the system), and should also prefer nodes with no CPUs, since presumably they'll have very little allocation pressure on them otherwise. It returns -1 if no node is found.

## COPYRIGHT
