From 53a15925da524d871b1331812cd9e91143fadc52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 6 Oct 2020 18:54:15 -0400 Subject: [PATCH] util: remove unused util_get_L3_for_pinned_thread Reviewed-by: Pierre-Eric Pelloux-Prayer Acked-by: Jose Fonseca Part-of: --- src/util/u_thread.h | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/util/u_thread.h b/src/util/u_thread.h index af44bcfc1bd..917ffead6a5 100644 --- a/src/util/u_thread.h +++ b/src/util/u_thread.h @@ -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.