Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4737583iob; Sun, 8 May 2022 23:47:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0HN7crqLWUkd2EjNKkLwHMu9yjSJfKm2GaWwkNyFtwUbghDGcHVGuYCDUkSpf5mkRtb7/ X-Received: by 2002:a17:902:a404:b0:14b:1100:aebc with SMTP id p4-20020a170902a40400b0014b1100aebcmr15409912plq.133.1652078828119; Sun, 08 May 2022 23:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652078828; cv=none; d=google.com; s=arc-20160816; b=Mi/hrGxcQ6eAJioPGwZsbhM3zE/cP0Pz/0CFXmJLlrCx7eUImvuvL0LgVav5JQ2qT5 4nAg+XFJUaqpWhOqiWofHfyBpC5RmB0K9g1Ye0atgpUPiNwbGsqLi58VzOLcAaqEwnN1 dH+1JksPVs3gNyF5thSg+zaHQVPnsQSOw47H0ynWsFithakqTu96NhtfA+Xp2pa37MWu axaFDf7NYZfzV4B5aWnxjMavNFxxlo9Nrr+Em88hI0X1ZKe/nBN/UXzdrbt2yxTS/kzD kYqKqySqqz3hVMtFCwqYbdwMzCW51uQ1sQJG/Kb2k3iSUc5fayGLYzi12I/EuJc6w6f3 q00Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tFroZ33tNBSAN1tcZa2Cw4zWBMi2iBtFH4Bzz4YsosU=; b=A5Yu6x1escQhnA37IHeTyA74TrTSpUkMwIsoq8v3Dj1cafSP+/68lpZoTHrUFmRYwm DAIbQ4ErgQe9vJ68+upHglOLoPLY03qbdnG6YJ/NmC+fKZbufGE6nbRWxIcWYH3z1W4i txLkUsHCwmyiAgeBuRTqATL4lj6xDn3O7D+JihXZfCuUKLlKmUEFijMdPchu+AKEZscB 4ZnftbvRfQr3lHuYuuCwxvevcMAzDtYTzsCgngfE7hXvmbUibGG36SVYYcUlvtdH6Ocr aqBGjS7Ek0UQ5gz+yGT0mJWu5rAgJU6C6LUKpMo0WsWg6dCpnzkKPKP+2KJz8z2Iq/tq cqBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r21-20020a63e515000000b003c2677d02a7si14097309pgh.90.2022.05.08.23.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:47:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 32C3F18A69A; Sun, 8 May 2022 23:43:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443836AbiEFQoF (ORCPT + 99 others); Fri, 6 May 2022 12:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245534AbiEFQoD (ORCPT ); Fri, 6 May 2022 12:44:03 -0400 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6426F6; Fri, 6 May 2022 09:40:18 -0700 (PDT) Received: by mail-qk1-f180.google.com with SMTP id j6so6270741qkp.9; Fri, 06 May 2022 09:40:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=tFroZ33tNBSAN1tcZa2Cw4zWBMi2iBtFH4Bzz4YsosU=; b=1g3R79/JZIjzSixj9uXtVSHj9hn7aspX+hluZvudL5HjakKQICBACLpIo9dPrfUaB4 KAFH6ONTbThZS1zKik09jYohsAPquNtsQeWLlRW8JQlgHq0eSa4Hdh/CAqvk9ZtD6/0A r/bihZePW50J33JLQqNjKe0b8UKw1QEWOdW+a732j33Qys0VsYlOlJFuwvt97rgopnpl nB4dD0++hXkWMiE4+teBFF2m9uQxiU7uWxO4v2Np3Q0wnmnRzoP9xnu7oh6+ka9KMOBn yIRUnJdsnDe1UTmBWnNcHMAo61Vlllp3EcT82NhQKOmHJ+0/9lP2nPmNsY13tuBv8cM9 VrjA== X-Gm-Message-State: AOAM5337DVXAMAHP5vohY5E/1sspSrMc1UXA5TjaHFD5VlUd/01rfctG CUr1goiQWbcmn3z4uuAPJfY= X-Received: by 2002:a05:620a:4045:b0:69f:e555:3fdf with SMTP id i5-20020a05620a404500b0069fe5553fdfmr3016293qko.365.1651855217645; Fri, 06 May 2022 09:40:17 -0700 (PDT) Received: from dev0025.ash9.facebook.com (fwdproxy-ash-012.fbsv.net. [2a03:2880:20ff:c::face:b00c]) by smtp.gmail.com with ESMTPSA id o22-20020ac84296000000b002f39b99f6a0sm2717130qtl.58.2022.05.06.09.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 09:40:17 -0700 (PDT) Date: Fri, 6 May 2022 09:40:15 -0700 From: David Vernet To: Michal =?utf-8?Q?Koutn=C3=BD?= Cc: akpm@linux-foundation.org, tj@kernel.org, roman.gushchin@linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, shakeelb@google.com, kernel-team@fb.com, Richard Palethorpe Subject: Re: [PATCH v2 2/5] cgroup: Account for memory_recursiveprot in test_memcg_low() Message-ID: <20220506164015.fsdsuv226nhllos5@dev0025.ash9.facebook.com> References: <20220423155619.3669555-1-void@manifault.com> <20220423155619.3669555-3-void@manifault.com> <20220427140928.GD9823@blackbody.suse.cz> <20220429010333.5rt2jwpiumnbuapf@dev0025.ash9.facebook.com> <20220429092620.GA23621@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220429092620.GA23621@blackbody.suse.cz> User-Agent: NeoMutt/20211029 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for the delayed reply, Michal. I've been at LSFMM this week. On Fri, Apr 29, 2022 at 11:26:20AM +0200, Michal Koutn? wrote: > I still think that the behavior when there's no protection left for the > memory.low == 0 child, there should be no memory.low events (not just > uncounted but not happening) and test should not accept this (even > though it's the current behavior). That's fair. I think part of the problem here is that in general, the memcontroller itself is quite heuristic, so it's tough to write tests that provide useful coverage while also being sufficiently flexible to avoid flakiness and over-prescribing expected behavior. In this case I think it's probably correct that the memory.low == 0 child shouldn't inherit protection from its parent under any circumstances due to its siblings overcommitting the parent's protection, but I also wonder if it's really necessary to enforce that. If you look at how much memory A/B/E gets at the end of the reclaim, it's still far less than 1MB (though should it be 0?). I'd be curious to hear what Johannes thinks. > What might improve the test space would be to have two configs like > > Original one (simplified here) > parent memory.low=50M memory.current=100M > ` child1 memory.low=50M memory.current=50M > ` child2 memory.low=0M memory.current=50M > > New one (checks events due to recursive protection) > parent memory.low=50M memory.current=100M > ` child1 memory.low=40M memory.current=50M > ` child2 memory.low=0M memory.current=50M > > The second config assigns recursive protection to child2 and should > therefore cause memory.low events in child2 (with memory_recursiveprot > enabled of course). Something like this would work, though I think it's useful to specifically validate the behavior of the memcontroller when the children overcommit the parent's memory.low protection, which the current test does. So I'm inclined to keep this testcase, and add your next suggestion: > Or alternative new one (checks events due to recursive protection) > parent memory.low=50M memory.current=100M > ` child1 memory.low=0M memory.current=50M > ` child2 memory.low=0M memory.current=50M This definitely sounds to me like a useful testcase to add, and I'm happy to do so in a follow-on patch. If we added this, do you think we need to keep the check for memory.low events for the memory.low == 0 child in the overcommit testcase? It arguably helped to catch the SWAP_CLUSTER_MAX rounding issue you pointed out. Again, curious to hear what Johannes thinks as well. Thanks, David