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=-2.3 required=3.0 tests=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 4AA5FC4BA18 for ; Wed, 26 Feb 2020 16:46:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24C0024688 for ; Wed, 26 Feb 2020 16:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727341AbgBZQqk (ORCPT ); Wed, 26 Feb 2020 11:46:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:58574 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbgBZQqj (ORCPT ); Wed, 26 Feb 2020 11:46:39 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C8D04AC46; Wed, 26 Feb 2020 16:46:36 +0000 (UTC) Date: Wed, 26 Feb 2020 17:46:32 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Johannes Weiner Cc: Andrew Morton , Roman Gushchin , Michal Hocko , Tejun Heo , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH v2 2/3] mm: memcontrol: clean up and document effective low/min calculations Message-ID: <20200226164632.GL27066@blackbody.suse.cz> References: <20191219200718.15696-1-hannes@cmpxchg.org> <20191219200718.15696-3-hannes@cmpxchg.org> <20200221171024.GA23476@blackbody.suse.cz> <20200225184014.GC10257@cmpxchg.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fDP66DSfTvWAYVew" Content-Disposition: inline In-Reply-To: <20200225184014.GC10257@cmpxchg.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fDP66DSfTvWAYVew Content-Type: multipart/mixed; boundary="QWRRbczYj8mXuejp" Content-Disposition: inline --QWRRbczYj8mXuejp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 25, 2020 at 01:40:14PM -0500, Johannes Weiner wrote: > Hm, this example doesn't change with my patch because there is no > "floating" protection that gets distributed among the siblings. Maybe it had changed even earlier and the example obsoleted. > In my testing with the above parameters, the equilibrium still comes > out to roughly this distribution. I'm attaching my test (10-times smaller) and I'm getting these results: > /sys/fs/cgroup/test.slice/memory.current:838750208 > /sys/fs/cgroup/test.slice/pressure.service/memory.current:616972288 > /sys/fs/cgroup/test.slice/test-A.slice/memory.current:221782016 > /sys/fs/cgroup/test.slice/test-A.slice/B.service/memory.current:123428864 > /sys/fs/cgroup/test.slice/test-A.slice/C.service/memory.current:93495296 > /sys/fs/cgroup/test.slice/test-A.slice/D.service/memory.current:4702208 > /sys/fs/cgroup/test.slice/test-A.slice/E.service/memory.current:155648 (I'm running that on 5.6.0-rc2 + first two patches of your series.) That's IMO closer to the my simulation (1.16:0.84) than the example prediction (1.3:0.6) > It's just to illustrate the pressure weight, not to reflect each > factor that can influence the equilibrium. But it's good to have some idea about the equilibrium when configuring the values.=20 > I think it still has value to gain understanding of how it works, no? Alas, the example confused me so that I had to write the simulation to get grasp of it :-) And even when running actual code now, I'd say the values in the original example are only one of the equlibriums but definitely not reachable from the stated initial conditions. > > > @@ -6272,12 +6262,63 @@ struct cgroup_subsys memory_cgrp_subsys =3D { > > > * for next usage. This part is intentionally racy, but it's ok, > > > * as memory.low is a best-effort mechanism. > > Although it's a different issue but since this updates the docs I'm > > mentioning it -- we treat memory.min the same, i.e. it's subject to the > > same race, however, it's not meant to be best effort. I didn't look into > > outcomes of potential misaccounting but the comment seems to miss impact > > on memory.min protection. >=20 > Yeah I think we can delete that bit. Erm, which part? Make the racy behavior undocumented or that it applies both memory.low and memory.min? > I believe we cleared this up in the parallel thread, but just in case: > reclaim can happen due to a memory.max set lower in the > tree. memory.low propagation is always relative from the reclaim > scope, not the system-wide root cgroup. Clear now. Michal --QWRRbczYj8mXuejp Content-Type: application/x-sh Content-Disposition: attachment; filename="run.sh" Content-Transfer-Encoding: quoted-printable #!/bin/bash=0A=0ACGPATH=3D/sys/fs/cgroup/test.slice=0A=0Afunction stop_test= () {=0A systemctl stop test.slice=0A}=0A=0Atrap stop_test SIGINT=0A=0Acat >= /etc/systemd/system/test.slice </etc/systemd/system/test-A.slice <