From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DE91C47096 for ; Thu, 3 Jun 2021 11:39:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D23CF613E3 for ; Thu, 3 Jun 2021 11:39:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D23CF613E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 60E966B0098; Thu, 3 Jun 2021 07:39:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BEA66B0099; Thu, 3 Jun 2021 07:39:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 437DA6B009A; Thu, 3 Jun 2021 07:39:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id 0E6876B0098 for ; Thu, 3 Jun 2021 07:39:01 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 97E66180AD802 for ; Thu, 3 Jun 2021 11:39:00 +0000 (UTC) X-FDA: 78212216040.16.B59C386 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by imf15.hostedemail.com (Postfix) with ESMTP id 41441A000262 for ; Thu, 3 Jun 2021 11:38:51 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id a11so3621207wrt.13 for ; Thu, 03 Jun 2021 04:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wiKfBxTb65s9ryPk0mFCpTofRIT4fNKHgWxxNUTFSrY=; b=LEUQzE+TXNrsF7VkTKq1fOZ1V0WA+d+HQMLVNnkA/g+4Qw712FXlgXSf8/gadK8Bro Kz2E5md4HlTtFR6XSPmsArHCMFvNKKbUz8s6bvVZ8h3VmtAvpACaB0RAtlLg2BQA0irt RAl3xa49jeclb3y6buUFOf1iCnIe8lU5lINRo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wiKfBxTb65s9ryPk0mFCpTofRIT4fNKHgWxxNUTFSrY=; b=hnXcujhO3mrNWYbbZj4Cu/oJ1Uw3PcXugs2dYVowMHZdVy+gfmkMSsLSfVwdlglnIY t4A4sNlXeSx2+68e22yf4N20T26H+YYCU0IYBQmMNcsQCx3UkGkTAsf6xYMEXmLZvP8D 1bLgmMaIM/E7xHO8VUXVv93J3JP0W+3DCiT8kNi/i0WswqcviyzQNNiv0Y//H3eYBNM+ ul/iF/BTSbdUZjsy4Z8VC+gtXic9930NioqRAGjCpXknC1MnwyyXDaH0eu8zf4tpJzew YN+q1D1jQWDtSseA6apwyn8I0Rc36YcDpWKQ5CYWG+PBYsFUESHO9wY4Pdm8dXcwBGZb xDlg== X-Gm-Message-State: AOAM533Rd/ndCcDbTx4kSE1YqshNU0VYY7DtHMrQ/ygcoyEtQVY+A4qN kDWrzN/f+VppOoRTbIIT/zE2Hg== X-Google-Smtp-Source: ABdhPJyiojPkL7BvnHVWyvRKsGmV8JltIBBNsXo803sUgldDWytbvs4czs072QurGSSHveY7DFRu1g== X-Received: by 2002:a5d:4c48:: with SMTP id n8mr8853436wrt.327.1622720338313; Thu, 03 Jun 2021 04:38:58 -0700 (PDT) Received: from localhost ([2620:10d:c093:400::5:6726]) by smtp.gmail.com with ESMTPSA id t14sm2962551wra.60.2021.06.03.04.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 04:38:57 -0700 (PDT) Date: Thu, 3 Jun 2021 12:38:57 +0100 From: Chris Down To: yulei zhang Cc: Shakeel Butt , Tejun Heo , Zefan Li , Johannes Weiner , Christian Brauner , Cgroups , benbjiang@tencent.com, Wanpeng Li , Yulei Zhang , Linux MM , Michal Hocko , Roman Gushchin Subject: Re: [RFC 0/7] Introduce memory allocation speed throttle in memcg Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.7 (481f3800) (2021-05-04) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=chrisdown.name header.s=google header.b=LEUQzE+T; dmarc=pass (policy=none) header.from=chrisdown.name; spf=pass (imf15.hostedemail.com: domain of chris@chrisdown.name designates 209.85.221.47 as permitted sender) smtp.mailfrom=chris@chrisdown.name X-Stat-Signature: jzdkows53wz1g947wpfbu7dm9bzzukz5 X-Rspamd-Queue-Id: 41441A000262 X-Rspamd-Server: rspam02 X-HE-Tag: 1622720331-372829 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: yulei zhang writes: >Thanks. IMHO, there are differences between these two throttlings. >memory.high is a per-memcg throttle which targets to limit the memory >usage of the tasks in the cgroup. For the memory allocation speed throttle(MST), >the purpose is to avoid the memory burst in cgroup which would trigger >the global reclaim and affects the timing sensitive workloads in other cgroup. >For example, we have two pods with memory overcommit enabled, one includes >online tasks and the other has offline tasks, if we restrict the memory usage of >the offline pod with memory.high, it will lose the benefit of memory overcommit >when the other workloads are idle. On the other hand, if we don't >limit the memory >usage, it will easily break the system watermark when there suddenly has massive >memory operations. If enable MST in this case, we will be able to >avoid the direct >reclaim and leverage the overcommit. Having a speed throttle is a very primitive knob: it's hard to know what the correct values are for a user. That's one of the reasons why we've moved away from that kind of tunable for blkio. Ultimately, if you want work-conserving behaviour, why not use memory.low? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Down Subject: Re: [RFC 0/7] Introduce memory allocation speed throttle in memcg Date: Thu, 3 Jun 2021 12:38:57 +0100 Message-ID: References: Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wiKfBxTb65s9ryPk0mFCpTofRIT4fNKHgWxxNUTFSrY=; b=LEUQzE+TXNrsF7VkTKq1fOZ1V0WA+d+HQMLVNnkA/g+4Qw712FXlgXSf8/gadK8Bro Kz2E5md4HlTtFR6XSPmsArHCMFvNKKbUz8s6bvVZ8h3VmtAvpACaB0RAtlLg2BQA0irt RAl3xa49jeclb3y6buUFOf1iCnIe8lU5lINRo= Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit To: yulei zhang Cc: Shakeel Butt , Tejun Heo , Zefan Li , Johannes Weiner , Christian Brauner , Cgroups , benbjiang-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org, Wanpeng Li , Yulei Zhang , Linux MM , Michal Hocko , Roman Gushchin yulei zhang writes: >Thanks. IMHO, there are differences between these two throttlings. >memory.high is a per-memcg throttle which targets to limit the memory >usage of the tasks in the cgroup. For the memory allocation speed throttle(MST), >the purpose is to avoid the memory burst in cgroup which would trigger >the global reclaim and affects the timing sensitive workloads in other cgroup. >For example, we have two pods with memory overcommit enabled, one includes >online tasks and the other has offline tasks, if we restrict the memory usage of >the offline pod with memory.high, it will lose the benefit of memory overcommit >when the other workloads are idle. On the other hand, if we don't >limit the memory >usage, it will easily break the system watermark when there suddenly has massive >memory operations. If enable MST in this case, we will be able to >avoid the direct >reclaim and leverage the overcommit. Having a speed throttle is a very primitive knob: it's hard to know what the correct values are for a user. That's one of the reasons why we've moved away from that kind of tunable for blkio. Ultimately, if you want work-conserving behaviour, why not use memory.low?