Skip to content

Commit

Permalink
Delete IsLocalToCpuPartition. It is only used in a test.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 704840865
Change-Id: Iee4c2acde4a02aa5d92f91e5acc713b9038d3448
  • Loading branch information
ckennelly authored and copybara-github committed Dec 10, 2024
1 parent bf7b22a commit d619ea3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
10 changes: 0 additions & 10 deletions tcmalloc/internal/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -261,12 +257,6 @@ inline uint64_t NumaTopology<NumPartitions, ScaleBy>::GetPartitionNodes(
return partition_to_nodes_[partition];
}

template <size_t NumPartitions, size_t ScaleBy>
inline bool NumaTopology<NumPartitions, ScaleBy>::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
Expand Down
14 changes: 0 additions & 14 deletions tcmalloc/internal/numa_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,6 @@ TEST_F(NumaTopologyTest, EmptyNode) {
}
}

TEST_F(NumaTopologyTest, IsLocalToCpuPartition) {
std::vector<SyntheticCpuList> 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) {
Expand Down

0 comments on commit d619ea3

Please sign in to comment.