util: remove unused util_get_L3_for_pinned_thread

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7054>
This commit is contained in:
Marek Olšák 2020-10-06 18:54:15 -04:00 committed by Marge Bot
parent cc16113202
commit 53a15925da

View file

@ -117,39 +117,6 @@ util_pin_thread_to_L3(thrd_t thread, unsigned L3_index, unsigned cores_per_L3)
#endif
}
/**
* Return the index of L3 that the thread is pinned to. If the thread is
* pinned to multiple L3 caches, return -1.
*
* \param thread thread
* \param cores_per_L3 number of CPU cores shared by one L3
*/
static inline int
util_get_L3_for_pinned_thread(thrd_t thread, unsigned cores_per_L3)
{
#if defined(HAVE_PTHREAD_SETAFFINITY)
cpu_set_t cpuset;
if (pthread_getaffinity_np(thread, sizeof(cpuset), &cpuset) == 0) {
int L3_index = -1;
for (unsigned i = 0; i < CPU_SETSIZE; i++) {
if (CPU_ISSET(i, &cpuset)) {
int x = i / cores_per_L3;
if (L3_index != x) {
if (L3_index == -1)
L3_index = x;
else
return -1; /* multiple L3s are set */
}
}
}
return L3_index;
}
#endif
return -1;
}
/*
* Thread statistics.