You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ma...@apache.org on 2025/01/08 03:33:09 UTC
(cloudberry) 04/16: remove resGroupId check in runaway detector
This is an automated email from the ASF dual-hosted git repository.
maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 15a9683ee320c4ccc64d785d7ebebb28529552ed
Author: wenru yan <yw...@vmware.com>
AuthorDate: Mon Mar 6 06:05:36 2023 +0000
remove resGroupId check in runaway detector
In previous version, we disable red-zone check for resource group,
the resgroup use cgroup to clean the process which consumes memory
exceeds the rg's configuration.
For the new version for resgroup, we use redZoneChunks to determine
whether the current process is in red-zone or not, so remove the
resGroupId check.
---
src/backend/utils/mmgr/redzone_handler.c | 31 -------------------------------
1 file changed, 31 deletions(-)
diff --git a/src/backend/utils/mmgr/redzone_handler.c b/src/backend/utils/mmgr/redzone_handler.c
index 03ab4fbfc6..a9d127c6c2 100644
--- a/src/backend/utils/mmgr/redzone_handler.c
+++ b/src/backend/utils/mmgr/redzone_handler.c
@@ -108,10 +108,6 @@ RedZoneHandler_ShmemInit()
* Also, during gpinitsystem we may start a QD without initializing the
* gp_vmem_protect_limit. This may result in 0 vmem protect limit. In such case,
* we ensure that the redZoneChunks is set to a large value.
- *
- * When we enable resource group, we will not use redZoneChunks to determine
- * whether the current process is in red-zone or not, so we can calculate the
- * redZoneChunks, but it'll never be used.
*/
if (runaway_detector_activation_percent != 0 &&
runaway_detector_activation_percent != 100 &&
@@ -163,7 +159,6 @@ RedZoneHandler_FlagTopConsumer()
Assert(NULL != MySessionState);
- Oid resGroupId = InvalidOid;
uint32 expected = 0;
bool success = pg_atomic_compare_exchange_u32((pg_atomic_uint32 *) isRunawayDetector, &expected, 1);
@@ -179,19 +174,6 @@ RedZoneHandler_FlagTopConsumer()
return;
}
- /*
- * In resource group mode, we should acquire ResGroupLock to avoid
- * resource group slot being changed during flag top consumer in redzone.
- * Note that flag top consumer is a low frequency action, so the
- * additional overhead is acceptable.
- *
- * Note that we also need to acquire SessionStateLock as well, so the lock
- * order is important to avoid deadlock. Make sure always acquire
- * ResGroupLock ahead.
- */
- if (IsResGroupEnabled())
- LWLockAcquire(ResGroupLock, LW_SHARED);
-
/*
* Grabbing a shared lock prevents others to modify the SessionState
* data structure, therefore ensuring that we don't flag someone
@@ -213,16 +195,6 @@ RedZoneHandler_FlagTopConsumer()
{
Assert(INVALID_SESSION_ID != curSessionState->sessionId);
- /*
- * in resgroup mode, we should only flag top consumer in group which uses
- * the most of the global shared memory
- */
- if (IsResGroupEnabled() && SessionGetResGroupId(curSessionState) != resGroupId)
- {
- curSessionState = curSessionState->next;
- continue;
- }
-
int32 curVmem = curSessionState->sessionVmem;
Assert(maxActiveVmem <= maxVmem);
@@ -322,9 +294,6 @@ RedZoneHandler_FlagTopConsumer()
}
LWLockRelease(SessionStateLock);
-
- if (IsResGroupEnabled())
- LWLockRelease(ResGroupLock);
}
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org