From d619ea3bec498af009b73eb4edc941cab419006f Mon Sep 17 00:00:00 2001 From: Chris Kennelly Date: Tue, 10 Dec 2024 14:09:53 -0800 Subject: [PATCH] Delete IsLocalToCpuPartition. It is only used in a test. PiperOrigin-RevId: 704840865 Change-Id: Iee4c2acde4a02aa5d92f91e5acc713b9038d3448 --- tcmalloc/internal/numa.h | 10 ---------- tcmalloc/internal/numa_test.cc | 14 -------------- 2 files changed, 24 deletions(-) diff --git a/tcmalloc/internal/numa.h b/tcmalloc/internal/numa.h index 2cd186264..d694f6638 100644 --- a/tcmalloc/internal/numa.h +++ b/tcmalloc/internal/numa.h @@ -139,10 +139,6 @@ class NumaTopology { // specified NUMA `partition`. uint64_t GetPartitionNodes(int partition) const; - // Returns whether the `size_class` is NUMA-partition-local to the given - // `cpu`. - bool IsLocalToCpuPartition(size_t size_class, int cpu) const; - private: // Maps from NUMA partition to a bitmap of NUMA nodes within the partition. uint64_t partition_to_nodes_[kNumInternalPartitions] = {0}; @@ -261,12 +257,6 @@ inline uint64_t NumaTopology::GetPartitionNodes( return partition_to_nodes_[partition]; } -template -inline bool NumaTopology::IsLocalToCpuPartition( - size_t size_class, int cpu) const { - return numa_aware() ? GetCpuPartition(cpu) == size_class / ScaleBy : true; -} - } // namespace tcmalloc_internal } // namespace tcmalloc GOOGLE_MALLOC_SECTION_END diff --git a/tcmalloc/internal/numa_test.cc b/tcmalloc/internal/numa_test.cc index 746132e0a..5a0ee3392 100644 --- a/tcmalloc/internal/numa_test.cc +++ b/tcmalloc/internal/numa_test.cc @@ -197,20 +197,6 @@ TEST_F(NumaTopologyTest, EmptyNode) { } } -TEST_F(NumaTopologyTest, IsLocalToCpuPartition) { - std::vector nodes; - nodes.emplace_back("0-1"); - nodes.emplace_back("2-3"); - - const auto nt = CreateNumaTopology<2, 2>(nodes); - - EXPECT_EQ(nt.numa_aware(), true); - EXPECT_TRUE(nt.IsLocalToCpuPartition(/*size_class=*/0, /*cpu=*/0)); - EXPECT_TRUE(nt.IsLocalToCpuPartition(/*size_class=*/2, /*cpu=*/2)); - EXPECT_FALSE(nt.IsLocalToCpuPartition(/*size_class=*/0, /*cpu=*/2)); - EXPECT_FALSE(nt.IsLocalToCpuPartition(/*size_class=*/2, /*cpu=*/0)); -} - // Test that cpulists too long to fit into the 16 byte buffer used by // InitNumaTopology() parse successfully. TEST_F(NumaTopologyTest, LongCpuLists) {