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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD3D6C433FE for ; Thu, 7 Apr 2022 14:15:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343841AbiDGORU (ORCPT ); Thu, 7 Apr 2022 10:17:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231286AbiDGORT (ORCPT ); Thu, 7 Apr 2022 10:17:19 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2EF428E33; Thu, 7 Apr 2022 07:15:11 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0EEFE1F85E; Thu, 7 Apr 2022 14:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649340899; 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=dKwrr1idTmWArX2lqn5YORjBOhR4BKEAOp87gdFGmAs=; b=JJOWpMh04HvpMRV9OHslNnYorECxh2BD2x5KOqtVFuXhlvMJYVYdpOespQ8gzdXuS+vIbr xcez1y5fivmjExddn6mXf7iZ7mev5ZvAdim89+c+9N8W2INFFncr1rhx9538zF0O2NhH+2 neOak+Z7R28zFIrQW/wC8IqrTMRVydg= 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 75EEAA3B87; Thu, 7 Apr 2022 14:14:58 +0000 (UTC) Date: Thu, 7 Apr 2022 16:14:57 +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: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 07-04-22 20:36:51, Zhaoyang Huang wrote: > On Thu, Apr 7, 2022 at 5:44 PM Michal Hocko wrote: > > > > [...] > > On Thu 07-04-22 16:59:50, Zhaoyang Huang wrote: > > > > This means that limits are altered even if there is memory to be > > > > reclaimed from other memcgs. Why? How does this line up with the > > > > basic property of the low limit to act as a protection from the reclaim? > > > ok, partially understand. I would like to say that low's original > > > definition under this patch has changed, says the calculated low just > > > provide protection when the psi value is lower than the setting and > > > will introduce reclaiming if it exceed. > > > > OK, I guess I finally get to understand what you are trying to say. So > > effectivelly your new semantic defines the low limit as an initial > > protection that is very soft and only preserved under a light global > > memory pressure[1]. If the reclaim pressure is higher the user provided > > protection is decreased. The new semantic is planned to be a global > > opt-in. > > > > Correct? > right. But I don't think the original protection is soft which could > be proved by the test result that the memcg is protected in a certain > range of pressure and could also help to release the system by > breaking low limit. Low limit protection is considered soft because it doesn't provide any guarantee. I will be ignored (and that will be reported to the userspace via LOW event) if there is nothing reclaimable in the scope of the reclaimed hierarchy. An alternative would be OOM actually. > > Now, that I (believe) to have a slightly better understanding I have to > > say I really dislike the idea. > > First of all the new semantic would have to be memcg reclaim aware. That > > means that the scaling logic would need to be aware where the memory > > pressure comes from. > I don't follow. Does it mean that the protected should distinguish the > pressure from global and other memcgs? I don't know why. No, it should behave consistently for any external memory pressure. A reclaimed memcg can apply different constraint depending on the root of the reclaim. Your solution is considering root to be root_memcg. [...] -- Michal Hocko SUSE Labs