| 154 | } |
| 155 | |
| 156 | static void |
| 157 | prepare_numa(int *oldpolicy, struct bitmask *oldmask, int socket_id) |
| 158 | { |
| 159 | RTE_LOG(DEBUG, EAL, "Trying to obtain current memory policy.\n"); |
| 160 | if (get_mempolicy(oldpolicy, oldmask->maskp, |
| 161 | oldmask->size + 1, 0, 0) < 0) { |
| 162 | RTE_LOG(ERR, EAL, |
| 163 | "Failed to get current mempolicy: %s. " |
| 164 | "Assuming MPOL_DEFAULT.\n", strerror(errno)); |
| 165 | *oldpolicy = MPOL_DEFAULT; |
| 166 | } |
| 167 | RTE_LOG(DEBUG, EAL, |
| 168 | "Setting policy MPOL_PREFERRED for socket %d\n", |
| 169 | socket_id); |
| 170 | numa_set_preferred(socket_id); |
| 171 | } |
| 172 | |
| 173 | static void |
| 174 | restore_numa(int *oldpolicy, struct bitmask *oldmask) |
no outgoing calls
no test coverage detected