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 56626C3601A for ; Fri, 4 Apr 2025 18:26:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15A876B000A; Fri, 4 Apr 2025 14:26:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 109626B000C; Fri, 4 Apr 2025 14:26:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F12DA6B000D; Fri, 4 Apr 2025 14:26:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D46F26B000A for ; Fri, 4 Apr 2025 14:26:25 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 57E68B75C7 for ; Fri, 4 Apr 2025 18:26:26 +0000 (UTC) X-FDA: 83297191572.15.9571DB5 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by imf09.hostedemail.com (Postfix) with ESMTP id 5E409140009 for ; Fri, 4 Apr 2025 18:26:24 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b="Rta/P1H0"; spf=pass (imf09.hostedemail.com: domain of mkoutny@suse.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=mkoutny@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743791184; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TLhJnFT3Gwgfc4DYQiW9AZKUF72F44NtVJtW3JeRxAo=; b=JaWUE6oQE+vICBaiBbmjwiGIcYBgAV4yhfUcdafYo7rtQqCZG0vnYzt4fxCecLF8xD3lMM RT7NZsQxz2IDVcyuAkhaUTH4xplWDD+5YwjAu0HQpIrOpog0Q5mhM9MM+sUxbQ56zaS3Jq +4JKhwrhTA20RJiWPx3LKBGkuqFAixo= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b="Rta/P1H0"; spf=pass (imf09.hostedemail.com: domain of mkoutny@suse.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=mkoutny@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743791184; a=rsa-sha256; cv=none; b=1iqroG8aW/N060LacwxCPvvWgtB4+6FhwK+ZCiulMW7bzVo2Ox1gBPtKs59QzCXDXP0T2d 6W4b1rEMuQwrKjSYNOC9jhSHTMQRGZoVMB50wj6XByNwvtb5gKl4bFgwVRPJOsqYPYWbCr uHqUUK12fEtRpDKrkyipJbtNTCo6sqU= Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3995ff6b066so1345402f8f.3 for ; Fri, 04 Apr 2025 11:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1743791183; x=1744395983; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TLhJnFT3Gwgfc4DYQiW9AZKUF72F44NtVJtW3JeRxAo=; b=Rta/P1H0CusM25oP0sEg5tcSN2BVoUFPieyQrqX+wxH3Ph3dTWLELhjRHnAkaud8Kr 4AIbHCn13XEXkG6KXAXJup8El1T2sobZ04ep4BFXae0/5rt4F4XarooaLazDwviD/Zj2 AK9inMs1j5ThOcngQiWlyqnCat5cNhpNXSmnhmW41zJCR1Rx4+1iCHhC4Xh4U2a468JT KTuGXRcgvW3VfMu7u6ax51K9ZKd7bc1xiP1o00gCIureMayhWF7Pm8JdSFNEP3P5kng1 i9zUL/VlPVULRIwH7yj3tOWMTWsxOZgWJDOH9wHorxiDzdwrZ5pFHtBagTErYl8uaQxt +onA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743791183; x=1744395983; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TLhJnFT3Gwgfc4DYQiW9AZKUF72F44NtVJtW3JeRxAo=; b=EEFwTGDAaoq/OmVx1Fude3vwB1jDFVfRLGT3FI7s2xhCSAQBRjL0GjhrF3orSNFlbG bNyJHi55piChBiHGP9iWeaamzuJWWSO85QQoblsNm6vsSJzMtfJdyLm7BB25RB+eHUyU mnI0DBGQaV9jVDVSwcgv/JD3JGA9K8fZk8sK8bEKERAvUGiHBfGxC68ld6KArysDFQ8V XmdozLOKnEpvhH574ztzG+yzL2DNbzCKY+TJdssK/uIWRDINt0N9kOxITT3x0VtfzLwP OrO3fuRZHZlpI3lgQkvZGDcvSoBc6nyZZ2q8p6sq0p3YLF3pwBUPSYnGZ3sXWalEFgBL EslQ== X-Forwarded-Encrypted: i=1; AJvYcCXb1EdIAj63R0Skfu2CcvcmjaxyOqkBsrH2TFLdARdCLelJqKPvkXQOEzk62DET1HwPVRgFV0KrOQ==@kvack.org X-Gm-Message-State: AOJu0Yy+ppJn97rna+agC0AIeMoI9rzyGzUVNiG+ygTHrMhrixrFXmd4 2o7GWz0OA5pW9MZyQMcm9UH+IrdP22YV6sEDWnNHa/0HfPgKiZm6BJ+a+tT0hd0= X-Gm-Gg: ASbGncs52rLQjqZMdHlO2kdwRdFI48CSXGrK7y7eP+fpzBF29qFGBFpIer2nzz3BECU n35wot+RD++QbxmkfiUFqBPO+isjSicOYFKGIJXzeaE9eDfVTCWGePlkC0dRQSwCDH/EoondRtO KGdDVIqGu62qJU3d2TmEoc7821QDl582iyJwjSlWDAvTVWOQfzrRtUL9Vled5MCBR4EXSTngUyG kF2lyCNGqqfzjyrTWmJXXQ0SjEp6ZKz9cjeoO23ueWpgV2A3Qu4Ww9NpXrCmMtzLWt57qKg5iO/ jUoh2qdIu1pbowBtaJZ1R18CWJN54WeWpr3Kx1k4bxw6YUM= X-Google-Smtp-Source: AGHT+IFVVzcvCxUkq7QqYrnEsRDzq8Ic4YqHD2DrlGgpG3HTOI3DOpixIDGv0syuaug71lzZJsL3oA== X-Received: by 2002:a05:6000:2406:b0:38f:3a89:fdb5 with SMTP id ffacd0b85a97d-39cb3575d97mr3948931f8f.11.1743791182544; Fri, 04 Apr 2025 11:26:22 -0700 (PDT) Received: from blackdock.suse.cz ([193.86.92.181]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c3020d975sm5041239f8f.75.2025.04.04.11.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 11:26:22 -0700 (PDT) Date: Fri, 4 Apr 2025 20:26:20 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Waiman Long Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Tejun Heo , Shuah Khan , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 1/2] memcg: Don't generate low/min events if either low/min or elow/emin is 0 Message-ID: References: <20250404012435.656045-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3ezm3guyzo3fa3j5" Content-Disposition: inline In-Reply-To: <20250404012435.656045-1-longman@redhat.com> X-Rspamd-Queue-Id: 5E409140009 X-Stat-Signature: rw3px8fr6byi3ugxc57kyaqh3sar544q X-Rspam-User: X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miLbJ1irRUTKubiVnAgD1/oYzrxHh30LY9FXtio0= 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: List-Subscribe: List-Unsubscribe: --3ezm3guyzo3fa3j5 Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v2 1/2] memcg: Don't generate low/min events if either low/min or elow/emin is 0 MIME-Version: 1.0 Hello Waiman. On Thu, Apr 03, 2025 at 09:24:34PM -0400, Waiman Long = wrote: > 1) memory.low is set to 0, but low events can still be triggered and > so the cgroup may have a non-zero low event count. I doubt users are > looking for that as they didn't set memory.low at all. I agree with this reasoning, been there [1] but fix ain't easy (also consensus of whether such an event should count or not and whether reclaim should happen or not). (See also [2] where I had tried other approaches that _didn't_ work.) > 2) memory.low is set to a non-zero value but the cgroup has no task in > it so that it has an effective low value of 0.=20 There maybe page cache remaining in the cgroup even with not present task inside it. > Again it may have a non-zero low event count if memory reclaim > happens. This is probably not a result expected by the users and it > is really doubtful that users will check an empty cgroup with no > task in it and expecting some non-zero event counts. Well, if memory.current > 0, some reclaim events can be justified and thus expected (e.g. by me). > The simple and naive fix of changing the operator to ">", however, > changes the memory reclaim behavior which can lead to other failures > as low events are needed to facilitate memory reclaim. So we can't do > that without some relatively riskier changes in memory reclaim. >=20 > Another simpler alternative is to avoid reporting below_low failure > if either memory.low or its effective equivalent is 0 which is done > by this patch specifically for the two failed use cases above. Admittedly, I haven't seen any complaints from real world about these events except for this test (which was ported from selftests to LTP too). > With this patch applied, the test_memcg_low sub-test finishes > successfully without failure in most cases. I'd say the simplest solution to make the test pass without figuring out what semantics of low events should be correct is not to check the memory.events:low at all with memory_recursiveprot (this is what was done in the cloned LTP test). Michal [1] https://lore.kernel.org/all/20220322182248.29121-1-mkoutny@suse.com/ [2] https://bugzilla.suse.com/show_bug.cgi?id=3D1196298 --3ezm3guyzo3fa3j5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTd6mfF2PbEZnpdoAkt3Wney77BSQUCZ/AkSQAKCRAt3Wney77B SXLwAQCLHjkGHqdonWWfAZmkRMLnnd/9GLDwQHs1pDPkdB+LygEAv1ILh4buquz3 RL8ZpTYF0zHvtsUdp9Ow556iY7pSSw8= =fCfQ -----END PGP SIGNATURE----- --3ezm3guyzo3fa3j5--