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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E43CEC433F5 for ; Mon, 4 Apr 2022 08:52:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 544326B007B; Mon, 4 Apr 2022 04:52:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4F2E16B007D; Mon, 4 Apr 2022 04:52:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BA8C6B007E; Mon, 4 Apr 2022 04:52:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 2A0586B007B for ; Mon, 4 Apr 2022 04:52:01 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id EE10A607B7 for ; Mon, 4 Apr 2022 08:51:50 +0000 (UTC) X-FDA: 79318578780.13.C64B199 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf11.hostedemail.com (Postfix) with ESMTP id 518974001B for ; Mon, 4 Apr 2022 08:51:50 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3A8BF1F37E; Mon, 4 Apr 2022 08:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649062309; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8dVesPMKaUut+TR+yGDooheAhutrkDr3IKERwS5AoSk=; b=llLqVXQVAuNVhRTxpopykvgOo5UDxL0+UVttQORgi7aeqOzxr0beKggQRRtiym8WzDZ4Qt GbJRJ10wLx240JOdmPbpx+/0eROIKFzQSN+bI6CSp2pTBrhNp1eNW3sGqfCOjn9fiS01bc 30ovvrP+E6SgyIM6U5zj5D9JlKi04HM= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B5AF2A3B87; Mon, 4 Apr 2022 08:51:48 +0000 (UTC) Date: Mon, 4 Apr 2022 10:51:48 +0200 From: Michal Hocko To: Zhaoyang Huang Cc: Suren Baghdasaryan , "zhaoyang.huang" , Andrew Morton , Johannes Weiner , Vladimir Davydov , "open list:MEMORY MANAGEMENT" , LKML , cgroups mailinglist , Ke Wang Subject: Re: [RFC PATCH] cgroup: introduce dynamic protection for memcg Message-ID: References: <1648713656-24254-1-git-send-email-zhaoyang.huang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 9k4x96hwnyw4yfnjcbhmoqjom7j8r5ty Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=llLqVXQV; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf11.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 518974001B X-HE-Tag: 1649062310-394392 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: On Mon 04-04-22 10:33:58, Zhaoyang Huang wrote: [...] > > One thing that I don't understand in this approach is: why memory.low > > should depend on the system's memory pressure. It seems you want to > > allow a process to allocate more when memory pressure is high. That is > > very counter-intuitive to me. Could you please explain the underlying > > logic of why this is the right thing to do, without going into > > technical details? > What I want to achieve is make memory.low be positive correlation with > timing and negative to memory pressure, which means the protected > memcg should lower its protection(via lower memcg.low) for helping > system's memory pressure when it's high. I have to say this is still very confusing to me. The low limit is a protection against external (e.g. global) memory pressure. Decreasing the protection based on the external pressure sounds like it goes right against the purpose of the knob. I can see reasons to update protection based on refaults or other metrics from the userspace but I still do not see how this is a good auto-magic tuning done by the kernel. > The concept behind is memcg's > fault back of dropped memory is less important than system's latency > on high memory pressure. Can you give some specific examples? > Please refer to my new version's test data > for more detail. Please note that sending new RFCs will just make the discussion spread over several email threads which will get increasingly hard to follow. So do not post another version until it is really clear what is the actual semantic you are proposing. -- Michal Hocko SUSE Labs