(Excuse my long turnarounds, I assume this needs time.) On Wed, Apr 16, 2025 at 04:29:13PM +0800, jingxiang zeng wrote: > ... > In fact, the memsw counter is mainly effective in proactive memory offload > scenarios. Is that some downstream experience or aspiration? Because there's no kernel where memsw and proactive reclaim coexist. > It is difficult to set an accurate memory.swap.max value. > memory.swap.current = [0GB, 9GB] > memory.swap.max = ? I likely don't understand, I'd consider the value of 10GB in this case... > The memory space saved by swapping out to swap can continue to load > the operation of system components or more workloads. > memory.limit_in_bytes = 10GB > memory.usage_in_bytes = 9GB - [0GB, 9GB] > memory.swap.current = [0GB, 9GB] > > The memory usage of memory.usage_in_bytes is reduced due to proactive > offload to swap, which will cause additional problems, such as: > 1. There may be some memory leaks or abnormal imported network traffic > in the container, which may cause OOM to fail to trigger or be triggered late; > 2. In the oversold scenario, if the container's memory requirement is 10GB, > the container's memory+swap should only use 10GB. ...which would mean per-container usage doesn't exceed 20GB (leaks remain bound). Apparently, you could fit less containers but would they be actually running (memsw doesn't guarantee that). Or what is problematic with different treatment of overcommit between memsw vs .max and .swap.max? Regards, Michal