From 6def8800faba95f799a178ed2218ad7257b51c92 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 2 Aug 2012 15:45:46 +0000 Subject: [PATCH] Track GC reclaims skipped in stats. --- src/backend/utils/hash/chash.c | 3 ++- src/include/utils/chash.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/hash/chash.c b/src/backend/utils/hash/chash.c index 5586ec5ac7..f74cc36da3 100644 --- a/src/backend/utils/hash/chash.c +++ b/src/backend/utils/hash/chash.c @@ -207,6 +207,7 @@ char *CHashStatisticsNames[] = { "garbage dequeues failed", "garbage collections", "garbage collection spins", + "garbage collection reclaims skipped", "garbage collection fast reclaims", "garbage collection reclaims retried", "" @@ -1005,7 +1006,7 @@ CHashAllocate(CHashTable table) * to adjust the next-pointer in the last of the reclaimed nodes. */ if (CHashPtrIsInvalid(fhead)) - ; + CHashTableIncrementStatistic(table, CHS_GC_Reclaim_Skipped); else if (__sync_bool_compare_and_swap(fh, InvalidCHashPtr, fhead)) CHashTableIncrementStatistic(table, CHS_GC_Reclaim_Fast); else diff --git a/src/include/utils/chash.h b/src/include/utils/chash.h index 8ff7e64039..2c4a1af1a0 100644 --- a/src/include/utils/chash.h +++ b/src/include/utils/chash.h @@ -45,6 +45,7 @@ typedef enum CHS_Garbage_Dequeue_Fail, /* dequeue of garbage failed */ CHS_GC, /* garbage collection cycle */ CHS_GC_Spin, /* GC spun waiting for concurrent process */ + CHS_GC_Reclaim_Skipped, /* GC recovered only one item */ CHS_GC_Reclaim_Fast, /* GC put garbage on freelist via fast path */ CHS_GC_Reclaim_Retry, /* enqueue of garbage on freelist retried */ CHS_NumberOfStatistics /* number of statistics */ -- 2.30.2