Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2518314rdb; Mon, 12 Feb 2024 07:26:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU4ZDmk2Y/aC/qOAybUvYAqK9FjCado24Cn/UHgCxatu6Ln42uXKErBCdgAyNZUcW+rivLCS125QdiLEqZR6H+dyP/pqVYEdhaTvoIU1w== X-Google-Smtp-Source: AGHT+IGPS2jG3Aq6XK/VVHGQk/mo+lNAyVHxuCqzyVWC88TMrm2DcytwwAGJ1bPKmrIIbt3Dzms2 X-Received: by 2002:ac8:5bd4:0:b0:42c:7e8d:9958 with SMTP id b20-20020ac85bd4000000b0042c7e8d9958mr2090126qtb.11.1707751617752; Mon, 12 Feb 2024 07:26:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707751617; cv=pass; d=google.com; s=arc-20160816; b=HbhA919Oi15qrJBQyx9h9UahJPK+Yl+OHEAXhYgc1vQpBjY0kWICB8mFCUZRrgZwsA qBurLW6HoahILoY0SMrVb7bMrWv9CWqaWNf/DMg6dNSTKbXZqqqNiQGhyamUxAk/Z3h7 zPozq98PZaifQ/IFY5DUXNeHhQ9wd5gA7+bDkZhI0Imc5gyrteJs8Vn2oJ/D1WtCr2Ru DVvrFHl1PHvitTshKu7AdRNcpZft8o9qzGqA5fQX2PtaCSW8BVFgzy0uibLtUeI6ZooM TpHXUBuVkRtkg9UE7/wuSXLc2YRV76U6PoS1AOSuUtHdrC41RK7T3NJV/J5KYXvQMFt8 880A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ylaC1wxOtmdVELv0CHaAgYwG4Tklp3Nu9mzaIJ8MpfQ=; fh=ZsbB7NuzfWMbGF+RS+UPiSAqPqpxMnai7sh3XgsCboU=; b=XbMt38/v2b9dpdx6RiQCBxYkjfUkRTF7Hr02sutj2nNs8ns8/1b4N2oFRq8QZ7+ot5 EBAwLfnazciWELuaXddAQAIbJ7lImluH61PuMjThXDa+OrPsheNAJ/wxsg+wmvDDFMcs Ufp6U+xQauORoiVdXhhq4S27f1a55riDQ/Aza887FR3pXm2ulLFxp6bk4JNRC8qxYGq+ W+ZXMWoPQrZjD6tEBYe2f1ewHmiYyo6TpmSGQjhYT8C+VmOEnRBw7w+zpLYg2+iUUJpO 2s97/ZpxcH5PIrk/NFm6PXAG09a/w1o/YfIHQSaGnhlttTJE625quHe2xKTVSbxvrQ/v OT3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O4yiV2VP; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-61892-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXW9JfZBK9+J+pOqA4Et+Edi9UgsMwnZL5NYjKdYQ9VwCB+FhsjEeeEOxvCms3+RI+QrHtKONrIe8CcQSGOC5NWvcm57KNMvrLokyoupg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w15-20020ac86b0f000000b0042c765939efsi601310qts.2.2024.02.12.07.26.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 07:26:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61892-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O4yiV2VP; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-61892-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 409EA1C21736 for ; Mon, 12 Feb 2024 15:26:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F6983C48D; Mon, 12 Feb 2024 15:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O4yiV2VP" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EED43C478 for ; Mon, 12 Feb 2024 15:26:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751610; cv=none; b=V+t35R5kYX24rzMy0GcbMKYN+kFq6HM18racbw12t9i73o+NhN9Bv+tGfofEbTNW3klqGuDATugafWcW3qAV3ZY+Fm69kJ/zCyAROz8uH8oD65kHn8tB+R6x7yyVl672s/GqAVfanFLAJcik+y+SnOzYPoaPYRWOQjZr9Lhgh9s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751610; c=relaxed/simple; bh=ylaC1wxOtmdVELv0CHaAgYwG4Tklp3Nu9mzaIJ8MpfQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=t8k3/8pW3jfTq2pOOarZj99b3bnv2jcaKyjH4feGsA6wWNBAP/GAokxrKmfPOpMBwMUQNjHCrFw0kUz09BaqGgcdwIqSOSrWHxLYMYh3yXAGSdKGKM5rMM0Lfe6ENjoBooFriaVvEnlqkqap/ur3yM7BEVzUgk7HCqAuSRMaGQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=O4yiV2VP; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707751608; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ylaC1wxOtmdVELv0CHaAgYwG4Tklp3Nu9mzaIJ8MpfQ=; b=O4yiV2VPgGCJ9vZI2gJiZ+UDlOGtvImxFfdr6fvoDnIV09EVuqN84y9UMTrO6WA/OVcguv wEaAoi3wISQrgMNjj6xz9USXYu+wisRU1UAMjGJ7a0c1NRnIU7I9ASdWSs4AOFRAIISDfW tn1rJYHqCH8vCbPnbUhXbFg6DJZpggU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455--AT9ag3PPyGuW6Mt9zfYVg-1; Mon, 12 Feb 2024 10:26:46 -0500 X-MC-Unique: -AT9ag3PPyGuW6Mt9zfYVg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F1E9A108BE69; Mon, 12 Feb 2024 15:26:42 +0000 (UTC) Received: from [10.22.33.62] (unknown [10.22.33.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F192112B5; Mon, 12 Feb 2024 15:26:42 +0000 (UTC) Message-ID: <8f8d5a2d-dde3-42e5-9988-fab042666f40@redhat.com> Date: Mon, 12 Feb 2024 10:26:42 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] Port hierarchical_{memory,swap}_limit cgroup1->cgroup2 Content-Language: en-US To: =?UTF-8?Q?Michal_Koutn=C3=BD?= , "Jan Kratochvil (Azul)" Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 On 2/12/24 10:00, Michal Koutný wrote: > Hello. > > Something like this would come quite handy. > > On Mon, Feb 12, 2024 at 12:10:38PM +0800, "Jan Kratochvil (Azul)" wrote: >> which are useful for userland to easily and performance-wise find out the >> effective cgroup limits being applied. > And the only way to figure out inside cgroupns. > >> But for cgroup2 it has been missing so far, this is just a copy-paste of the >> cgroup1 code while changing s/memsw/swap/ as that is what cgroup1 vs. cgroup2 >> tracks. I have added it to the end of "memory.stat" to prevent possible >> compatibility problems with existing code parsing that file. > I was thinking of memory.max.effective (and others). > > - no need to (possibly flush) stats when reading memory.stat > - can be generalized also for pids controller (and other "limiting" controllers) > - analogous to precedent of cpuset.cpus.effective > > Whereas, using v1 approach in v2: > - memory.stat mixes true stats and limits, > - memmory.stat is hierarchical by default, no need for the prefix. > > What do you think of the separate .effective file(s)? This is certainly a good alternative. Cheers, Longman