[PATCH v2 4/4] conf: Deduplicate NUMA distance code