From: Unsung Lee Date: Thu, 9 Nov 2023 07:37:23 +0000 (+0900) Subject: lowmem-limit: Remove useless max limit size check X-Git-Tag: accepted/tizen/7.0/unified/20231122.175032~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=284b1d5b5b69ec6d4b8f411bc8423ea8a703bd51;p=platform%2Fcore%2Fsystem%2Fresourced.git lowmem-limit: Remove useless max limit size check Resourced already resizes limit size when limit size is larger than total memory size. Change-Id: I71cf191f07c398e1916bbe6d1397874e7f6df302 Signed-off-by: Unsung Lee --- diff --git a/src/resource-limiter/memory/lowmem-limit.c b/src/resource-limiter/memory/lowmem-limit.c index f30e327..465700a 100644 --- a/src/resource-limiter/memory/lowmem-limit.c +++ b/src/resource-limiter/memory/lowmem-limit.c @@ -447,9 +447,8 @@ int lowmem_limit_set_system_service(pid_t pid, unsigned long long limit_bytes, { _cleanup_free_ char *path = NULL; int result; - unsigned long long totalram_bytes = lowmem_get_totalram(); - if (limit_bytes < MIN_LIMIT_VALUE || limit_bytes > totalram_bytes) { + if (limit_bytes < MIN_LIMIT_VALUE) { _E("[MEMORY-LIMIT] It's meaningless to set memory limit with size (%llu) bytes", limit_bytes); return RESOURCED_ERROR_INVALID_PARAMETER; } @@ -498,9 +497,8 @@ int lowmem_limit_set_app(unsigned long long limit_bytes, struct proc_app_info *p _cleanup_free_ char *path = NULL; GSList *iter = NULL; int result; - unsigned long long totalram_bytes = lowmem_get_totalram(); - if (limit_bytes < MIN_LIMIT_VALUE || limit_bytes > totalram_bytes) { + if (limit_bytes < MIN_LIMIT_VALUE) { _E("[MEMORY-LIMIT] It's meaningless to set memory limit with size (%llu) bytes", limit_bytes); return RESOURCED_ERROR_INVALID_PARAMETER; }