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 2B5DAC4BA13 for ; Wed, 26 Feb 2020 16:46:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ECADC2467B for ; Wed, 26 Feb 2020 16:46:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECADC2467B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 854F06B0005; Wed, 26 Feb 2020 11:46:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DD956B0006; Wed, 26 Feb 2020 11:46:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CC7B6B0007; Wed, 26 Feb 2020 11:46:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id 5048E6B0005 for ; Wed, 26 Feb 2020 11:46:40 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5844D2C81 for ; Wed, 26 Feb 2020 16:46:40 +0000 (UTC) X-FDA: 76532856960.29.silk93_57487635ab21e X-HE-Tag: silk93_57487635ab21e X-Filterd-Recvd-Size: 6846 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Feb 2020 16:46:39 +0000 (UTC) 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) 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: --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 <