hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject incubator-hawq git commit: HAWQ-170. Rename GUC gp_vmem_protect_limit to hawq_re_memory_overcommit_max to reflect latest memory enforcement implementation
Date Thu, 19 Nov 2015 02:12:34 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master e5afa4e2b -> 5475f1ab9


HAWQ-170. Rename GUC gp_vmem_protect_limit to hawq_re_memory_overcommit_max to reflect latest
memory enforcement implementation


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/5475f1ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/5475f1ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/5475f1ab

Branch: refs/heads/master
Commit: 5475f1ab9885bb293ae604dbee3ec8481e7679ce
Parents: e5afa4e
Author: Ruilong Huo <rhuo@pivotal.io>
Authored: Tue Nov 17 00:42:57 2015 -0800
Committer: Ruilong Huo <rhuo@pivotal.io>
Committed: Thu Nov 19 10:12:26 2015 +0800

----------------------------------------------------------------------
 doc/src/sgml/ref/create_resource_queue.sgml     |  2 +-
 src/backend/postmaster/perfmon_segmentinfo.c    |  2 +-
 src/backend/utils/init/globals.c                |  4 ++--
 src/backend/utils/misc/guc.c                    |  6 +++---
 src/backend/utils/misc/postgresql.conf.sample   |  2 +-
 src/backend/utils/mmgr/memprot.c                |  8 ++++----
 src/backend/utils/mmgr/redzone_handler.c        |  2 +-
 src/backend/utils/mmgr/test/vmem_tracker_test.c | 18 +++++++++---------
 src/backend/utils/mmgr/vmem_tracker.c           |  6 +++---
 src/include/miscadmin.h                         |  2 +-
 src/test/unit/mock/mock_info.json               |  2 +-
 tools/bin/gpcheck                               |  2 +-
 tools/bin/lib/gpcheckdb.py                      |  2 +-
 13 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/doc/src/sgml/ref/create_resource_queue.sgml
----------------------------------------------------------------------
diff --git a/doc/src/sgml/ref/create_resource_queue.sgml b/doc/src/sgml/ref/create_resource_queue.sgml
index becfb0e..28e6ef5 100755
--- a/doc/src/sgml/ref/create_resource_queue.sgml
+++ b/doc/src/sgml/ref/create_resource_queue.sgml
@@ -120,7 +120,7 @@ where queue_attribute is:
    exceed the amount of physical memory of a segment host.If workloads are staggered 
    over multiple queues, memory allocations can be oversubscribed. However, queries 
    can be cancelled during execution if the segment host memory limit specified 
-   in gp_vmem_protect_limit is exceeded.
+   in hawq_re_memory_overcommit_max is exceeded.
   </para>
 
  </refsect1>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/backend/postmaster/perfmon_segmentinfo.c
----------------------------------------------------------------------
diff --git a/src/backend/postmaster/perfmon_segmentinfo.c b/src/backend/postmaster/perfmon_segmentinfo.c
index cac6a7e..5f3f4e5 100644
--- a/src/backend/postmaster/perfmon_segmentinfo.c
+++ b/src/backend/postmaster/perfmon_segmentinfo.c
@@ -167,7 +167,7 @@ NON_EXEC_STATIC void SegmentInfoSenderMain(int argc, char *argv[])
 	MyBackendId = InvalidBackendId;
 
 	/*
-	 * Save gp_vmem_protect_limit value in bytes.
+	 * Save hawq_re_memory_overcommit_max value in bytes.
 	 * This value cannot change after starting the server.
 	 */
 	mem_alloc_max = VmemTracker_GetVmemLimitBytes();

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/backend/utils/init/globals.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
index 07db4c2..3ea1428 100644
--- a/src/backend/utils/init/globals.c
+++ b/src/backend/utils/init/globals.c
@@ -146,8 +146,8 @@ bool	pljava_debug = false;
 
 /* Memory protection GUCs*/
 #ifdef __darwin__
-int gp_vmem_protect_limit = 8192;
+int hawq_re_memory_overcommit_max = 8192;
 #else
-int gp_vmem_protect_limit = 8192;
+int hawq_re_memory_overcommit_max = 8192;
 #endif
 int gp_vmem_protect_gang_cache_limit = 500;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/backend/utils/misc/guc.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index c71409d..60c48c4 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -5980,11 +5980,11 @@ static struct config_int ConfigureNamesInt[] =
 	},
 
 	{
-		{"gp_vmem_protect_limit", PGC_POSTMASTER, RESOURCES_MEM,
-			gettext_noop("Virtual memory limit (in MB) of Greenplum memory protection."),
+		{"hawq_re_memory_overcommit_max", PGC_POSTMASTER, RESOURCES_MEM,
+			gettext_noop("Maximum quota of memory overcommit (in MB) per HAWQ physical segment in
resource enforcement"),
 			NULL,
 		},
-		&gp_vmem_protect_limit,
+		&hawq_re_memory_overcommit_max,
 #ifdef __darwin__
         8192,
 #else

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/backend/utils/misc/postgresql.conf.sample
----------------------------------------------------------------------
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 466221b..acf0d2d 100755
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -490,7 +490,7 @@ gp_segment_connect_timeout = 600s
 #gp_enable_delete_as_truncate = off
 
 # - Resource limits -
-gp_vmem_protect_limit = 8192  #Virtual memory limit (in MB).
+hawq_re_memory_overcommit_max = 8192  # Maximum quota of memory overcommit (in MB) per HAWQ
physical segment in resource enforcement
 #gp_vmem_idle_resource_timeout = 18000 # idle-time before gang-release, in milliseconds (zero
disables release).
 
 #------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/backend/utils/mmgr/memprot.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/mmgr/memprot.c b/src/backend/utils/mmgr/memprot.c
index acfd17f..d0e74ec 100644
--- a/src/backend/utils/mmgr/memprot.c
+++ b/src/backend/utils/mmgr/memprot.c
@@ -480,7 +480,7 @@ void gp_free2(void *ptr, int64 sz)
 
 static inline bool gp_memprot_dynamic_enabled()
 {
-	return (gp_vmem_protect_limit > 0);
+	return (hawq_re_memory_overcommit_max > 0);
 }
 
 int gp_update_mem_quota(int mem_quota_total)
@@ -496,13 +496,13 @@ int gp_update_mem_quota(int mem_quota_total)
 			return RESENFORCER_FAIL_UPDATE_MEMORY_QUOTA;
 		}
 
-		if (mem_quota_total > VmemTracker_GetPhysicalMemQuotaInMB() - gp_vmem_protect_limit)
+		if (mem_quota_total > VmemTracker_GetPhysicalMemQuotaInMB() - hawq_re_memory_overcommit_max)
 		{
-			mem_quota_total = VmemTracker_GetPhysicalMemQuotaInMB() - gp_vmem_protect_limit;
+			mem_quota_total = VmemTracker_GetPhysicalMemQuotaInMB() - hawq_re_memory_overcommit_max;
 			elog(LOG, "Greenplum memory protection sets memory counter to its maximum value");
 		}
 
-		mem_quota_total = VmemTracker_ConvertVmemMBToChunks(mem_quota_total + gp_vmem_protect_limit);
+		mem_quota_total = VmemTracker_ConvertVmemMBToChunks(mem_quota_total + hawq_re_memory_overcommit_max);
 
 		ret = VmemTracker_SetDynamicMemoryQuotaSema(mem_quota_total);
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/backend/utils/mmgr/redzone_handler.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/mmgr/redzone_handler.c b/src/backend/utils/mmgr/redzone_handler.c
index 9cf85b9..b5fdb42 100644
--- a/src/backend/utils/mmgr/redzone_handler.c
+++ b/src/backend/utils/mmgr/redzone_handler.c
@@ -75,7 +75,7 @@ RedZoneHandler_GetRedZoneLimitChunks()
 	/*
 	 * runaway_detector_activation_percent = 100% is reserved for not enforcing runaway
 	 * detection by setting the redZoneChunks to an artificially high value. Also, during
-	 * gpinitsystem we may start a QD without initializing the gp_vmem_protect_limit.
+	 * gpinitsystem we may start a QD without initializing the hawq_re_memory_overcommit_max.
 	 * This may result in 0 vmem protect limit. In such case, we ensure that the
 	 * redZoneChunks is set to a large value.
 	 */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/backend/utils/mmgr/test/vmem_tracker_test.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/mmgr/test/vmem_tracker_test.c b/src/backend/utils/mmgr/test/vmem_tracker_test.c
index 70fba9f..86a90af 100644
--- a/src/backend/utils/mmgr/test/vmem_tracker_test.c
+++ b/src/backend/utils/mmgr/test/vmem_tracker_test.c
@@ -101,7 +101,7 @@ void VmemTrackerTestSetup(void **state)
 	OOMEventSetup();
 
 	/* 8GB default VMEM */
-	gp_vmem_protect_limit = 8192;
+	hawq_re_memory_overcommit_max = 8192;
 	/* Disable runaway detector */
 	runaway_detector_activation_percent = 100;
 
@@ -535,7 +535,7 @@ SetVmemLimit(int32 newSegmentVmemLimitMB, int32 newSessionVmemLimitMB)
 
 	IsUnderPostmaster = false;
 
-	gp_vmem_protect_limit = newSegmentVmemLimitMB;
+	hawq_re_memory_overcommit_max = newSegmentVmemLimitMB;
 	/* Session vmem limit is in kB unit */
 	gp_vmem_limit_per_query = newSessionVmemLimitMB * 1024;
 	will_return(VmemTracker_GetPhysicalMemQuotaInMB, newSegmentVmemLimitMB);
@@ -554,22 +554,22 @@ test__VmemTracker_ShmemInit__QuotaCalculation(void **state)
 {
 	SetVmemLimit(0, 1024);
 	assert_true(chunkSizeInBits == BITS_IN_MB);
-	assert_true(*segmentVmemQuotaChunks == gp_vmem_protect_limit);
+	assert_true(*segmentVmemQuotaChunks == hawq_re_memory_overcommit_max);
 	assert_true(maxChunksPerQuery == (gp_vmem_limit_per_query / 1024));
 
 	SetVmemLimit(1024 * 8, 1024);
 	assert_true(chunkSizeInBits == BITS_IN_MB);
-	assert_true(*segmentVmemQuotaChunks == gp_vmem_protect_limit);
+	assert_true(*segmentVmemQuotaChunks == hawq_re_memory_overcommit_max);
 	assert_true(maxChunksPerQuery == (gp_vmem_limit_per_query / 1024));
 
 	SetVmemLimit(1024 * 16 + 1, 1024);
 	assert_true(chunkSizeInBits == BITS_IN_MB + 1);
-	assert_true(*segmentVmemQuotaChunks == gp_vmem_protect_limit / 2);
+	assert_true(*segmentVmemQuotaChunks == hawq_re_memory_overcommit_max / 2);
 	assert_true(maxChunksPerQuery == (gp_vmem_limit_per_query / (1024 * 2)));
 
 	SetVmemLimit(1024 * 32, 1024);
 	assert_true(chunkSizeInBits == BITS_IN_MB + 1);
-	assert_true(*segmentVmemQuotaChunks == gp_vmem_protect_limit / 2);
+	assert_true(*segmentVmemQuotaChunks == hawq_re_memory_overcommit_max / 2);
 	assert_true(maxChunksPerQuery == (gp_vmem_limit_per_query / (1024 * 2)));
 
 	/*
@@ -578,7 +578,7 @@ test__VmemTracker_ShmemInit__QuotaCalculation(void **state)
 	 */
 	SetVmemLimit(1024 * 32 + 1, 1024);
 	assert_true(chunkSizeInBits == BITS_IN_MB + 1);
-	assert_true(*segmentVmemQuotaChunks == gp_vmem_protect_limit / 2);
+	assert_true(*segmentVmemQuotaChunks == hawq_re_memory_overcommit_max / 2);
 	assert_true(maxChunksPerQuery == (gp_vmem_limit_per_query / (1024 * 2)));
 
 	/*
@@ -587,12 +587,12 @@ test__VmemTracker_ShmemInit__QuotaCalculation(void **state)
 	 */
 	SetVmemLimit(1024 * 32 + 2, 1024);
 	assert_true(chunkSizeInBits == BITS_IN_MB + 2);
-	assert_true(*segmentVmemQuotaChunks == gp_vmem_protect_limit / 4);
+	assert_true(*segmentVmemQuotaChunks == hawq_re_memory_overcommit_max / 4);
 	assert_true(maxChunksPerQuery == (gp_vmem_limit_per_query / (1024 * 4)));
 
 	SetVmemLimit(1024 * 64 + 4, 1024);
 	assert_true(chunkSizeInBits == BITS_IN_MB + 3);
-	assert_true(*segmentVmemQuotaChunks == gp_vmem_protect_limit / 8);
+	assert_true(*segmentVmemQuotaChunks == hawq_re_memory_overcommit_max / 8);
 	assert_true(maxChunksPerQuery == (gp_vmem_limit_per_query / (1024 * 8)));
 
 	/* Reset to default for future test sanity */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/backend/utils/mmgr/vmem_tracker.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/mmgr/vmem_tracker.c b/src/backend/utils/mmgr/vmem_tracker.c
index abd7b1d..171af5a 100644
--- a/src/backend/utils/mmgr/vmem_tracker.c
+++ b/src/backend/utils/mmgr/vmem_tracker.c
@@ -165,7 +165,7 @@ VmemTracker_ShmemInit()
 		physicalMemQuotaInMB = VmemTracker_GetPhysicalMemQuotaInMB();
 		physicalMemQuotaInChunks = physicalMemQuotaInMB;
 
-		int32 vmemChunksQuota = gp_vmem_protect_limit;
+		int32 vmemChunksQuota = hawq_re_memory_overcommit_max;
 		/*
 		 * If vmem is larger than 16GB (i.e., 16K MB), we make the chunks bigger
 		 * so that the vmem limit in chunks unit is not larger than 16K.
@@ -178,7 +178,7 @@ VmemTracker_ShmemInit()
 		}
 
 		/* There is at least one chunk if memory enforcement is enabled */
-		if (gp_vmem_protect_limit > 0)
+		if (hawq_re_memory_overcommit_max > 0)
 		{
 			vmemChunksQuota = Max(vmemChunksQuota, (int32)1);
 		}
@@ -689,7 +689,7 @@ VmemTracker_Fault(int32 reason, int64 arg)
 	switch(reason)
 	{
 	case GP_FAULT_USER_MP_CONFIG:
-		return (int64) gp_vmem_protect_limit;
+		return (int64) hawq_re_memory_overcommit_max;
 	case GP_FAULT_USER_MP_ALLOC:
 		return (int64) (BYTES_TO_MB(VmemTracker_GetReservedVmemBytes()));
 	case GP_FAULT_USER_MP_HIGHWM:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/include/miscadmin.h
----------------------------------------------------------------------
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 7b9ea19..8a90b5e 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -313,7 +313,7 @@ extern int	VacuumCostDelay;
 extern int	VacuumCostBalance;
 extern bool VacuumCostActive;
 
-extern int gp_vmem_protect_limit;
+extern int hawq_re_memory_overcommit_max;
 extern int gp_vmem_protect_gang_cache_limit;
 
 /* in tcop/postgres.c */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/src/test/unit/mock/mock_info.json
----------------------------------------------------------------------
diff --git a/src/test/unit/mock/mock_info.json b/src/test/unit/mock/mock_info.json
index 489c69c..a45129c 100644
--- a/src/test/unit/mock/mock_info.json
+++ b/src/test/unit/mock/mock_info.json
@@ -14504,7 +14504,7 @@
             "filename": "src/backend/tcop/postgres.c", 
             "header filename": "src/include/miscadmin.h"
         }, 
-        "gp_vmem_protect_limit": {
+        "hawq_re_memory_overcommit_max": {
             "filename": "src/backend/tcop/postgres.c", 
             "header filename": "src/include/miscadmin.h"
         }, 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/tools/bin/gpcheck
----------------------------------------------------------------------
diff --git a/tools/bin/gpcheck b/tools/bin/gpcheck
index f56eb1a..29f5183 100755
--- a/tools/bin/gpcheck
+++ b/tools/bin/gpcheck
@@ -148,7 +148,7 @@ pool = WorkerPool()
 tmpdir = None
 found_errors = 0
 
-HAWQ_GUC_MEMORY    = "gp_vmem_protect_limit"
+HAWQ_GUC_MEMORY    = "hawq_re_memory_overcommit_max"
 
 
 def checkPlatform():

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5475f1ab/tools/bin/lib/gpcheckdb.py
----------------------------------------------------------------------
diff --git a/tools/bin/lib/gpcheckdb.py b/tools/bin/lib/gpcheckdb.py
index 044a6f9..52cf8b9 100644
--- a/tools/bin/lib/gpcheckdb.py
+++ b/tools/bin/lib/gpcheckdb.py
@@ -272,7 +272,7 @@ def main():
     # check for users not associated with any resource queues
     chk_users_without_resource_queues()
 
-    # check for a few guc settings (e.g., gp_vmem_protect_limit)
+    # check for a few guc settings (e.g., hawq_re_memory_overcommit_max)
     chk_guc()
 
 


Mime
View raw message