Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2081680lqe; Tue, 9 Apr 2024 09:03:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVw1Uh1jSQ0g8O0+ZF+DNvynMzPis547Uaah2TYyYJl+xRQQjnsBWv8AopOR9C8ZjyeN4I5WXLDgj55dn50FtBFECk7tgJ1AYzb+P3whg== X-Google-Smtp-Source: AGHT+IHB01+We1fIb3Kjlz+b2XDj4O+CfEkp6PTOFAh7MHwoGgl/x9nX1ZXIDVOnVOx/5aCS1CvY X-Received: by 2002:a05:620a:5622:b0:78d:63e7:9dd3 with SMTP id vv2-20020a05620a562200b0078d63e79dd3mr54705qkn.75.1712678585011; Tue, 09 Apr 2024 09:03:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712678584; cv=pass; d=google.com; s=arc-20160816; b=05XT29L6Oozm4zBTGPySJzGHaDz9/eZwAkdvvjwfucF3+8kzCdLtgQXV/pXEylYu29 rhMnhWIaowpbjBs7JqmBh7lj35RQHfS0B0D9gON802/jCWkVtMQmpcnAs5UaVdcG+oF+ NqbevL8VlqpWLKdFVGY18Gp2MZj0MEzDD/Yf77qSVqCX4C5HPoINXvu4Px/M1oQt8KBY hf6sUWIdYT1MQCOFKDyf3FUqa+8GIExaz5Rmri8+E9Ysgo0XXI8PN1ZqdUb8nC1rDkc6 bp8nGd4SCHvhXTBvp8XJHy3F6FBLNAbVxmUAa8eJC3kPgAii6nV3SspYSht//1hIttIf KIbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cqPDnUUjz+kqldNCaECmKcsoHhRA5eglyoZJn6Trgmg=; fh=1ZDSjSiIq9cy8IyCdSvQGzNnX0kSB+KJPSvU0v2to34=; b=sqPa4zcc7m9bZLCVZMj4qkWgz8knsX2iQpPLqvpwB97tWEgstmbm9uggoEgv54WWyB VOeTKnNtOuiVjdtzXCcZ1m9sqGkVnpbgw9c3w7wpFf30zI7uf4vAOr+xvKp/J17VspH2 9AH3OWeKcscIhduLDmaOr09KYOoJs3f1sAyqQD4D7AmaFa5qmGdI5lQ00l1fwzVoyY0I bcxqPwvMMzUCsF+WHA43etCOXsATt2pXKhjUz34N4dzFZz4DUwWxaJ6IO5xsUhWCt+we 4FTrPYxhc2w91NBlh40tU9SoRRRH5Mc2k4PmKbUfS4ELwUEPrTb5WzlJmVPME6uA/RI4 HHqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=cFbC+aHp; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-137287-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137287-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w9-20020a05620a0e8900b0078d39f00afesi9813102qkm.9.2024.04.09.09.03.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 09:03:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137287-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=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=cFbC+aHp; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-137287-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137287-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org 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 9521E1C20FE6 for ; Tue, 9 Apr 2024 16:03:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C99413D8A4; Tue, 9 Apr 2024 16:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b="cFbC+aHp" Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AF5213D635 for ; Tue, 9 Apr 2024 16:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712678570; cv=none; b=P3XX7N+czsnu4hd1LDjdpiKfM3B8sp27Tvh83jm/iZ4Ls+gzPLA+obYv8w5DC0zWCuDU2d6CB3yTusz4U3ZD3iOLHLVvoBRJ7GeuyZIM2o6su7jHLoDbP5AoEkIsrz0W0WYITkkzFIdO31sOKFMtZ5PbzCVoLid+GaXIyZEJ6fI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712678570; c=relaxed/simple; bh=dyL+TLXIFrRx9Lp5PrForFMQ5coJeHhlaD95G4Nkex4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A06CWKcA/kDlT8l0Ty0D0FURRo8CLuQUfhtPPjmNdIfWF/QRIuMbSd+Yc7HyjbNjz/BCmOrruOrvLh7jprxEORLQ+TI7nSpKpCpl7VnqLemxzgmvAk2YnAjPVfBc5VonC6HZPhnKUkROdORB36NXYKfgiDO3jWwpWCAK+zcMec4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b=cFbC+aHp; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-22f32226947so1225443fac.2 for ; Tue, 09 Apr 2024 09:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1712678567; x=1713283367; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=cqPDnUUjz+kqldNCaECmKcsoHhRA5eglyoZJn6Trgmg=; b=cFbC+aHp4L0u99cQueshGb2OyxJygUyW51VW1PlaL42GL5fVSk8i6pKHcDcMNFQy8b dvRcySxYAOd9RLXXzSK7cMTp2WnL9/RjeWGNtre+Bvw648YJJH8jC8ByiFuw3ScLTt57 W/vBdHsBQUaDYB/EYie3Q8tyFt31KpsQy1xCa+S8Dq/2JzTrfF724TMBFgD+kvSBIeMW kk+j6jERo8QvKYvXir0aeTJKwWs5JGGxdwHtVuD42GKXfuTww0g8XrIANMPLZU0E4xFr eCzHoUxTMia0C1GXgDaqF4xmiEX2gjCoH+QBNTBHCUcLf4ETCCOaX6lxyyvzZaDGxnIz 0CMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712678567; x=1713283367; h=in-reply-to:content-transfer-encoding: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=cqPDnUUjz+kqldNCaECmKcsoHhRA5eglyoZJn6Trgmg=; b=Ory1r1EQmwI91A2weYk5f5sKQL2r0SaFZxkeEULW5K9Vq+lW3QvX6BytYQ8aERM9Fp R2yovTvasaNCIGe2pkRzm7Q8qsUAuVQpMQ/yZNl1tWLJNw5iiWUz01+ugR0AWjPf+v49 vTkn9h9CS3b9Q/i2WlrcXF83CAg/zC3BBSai4NU4fjpd3oVSGBKZ2foZsBDCQ5ws2xA4 950AqEUUGuiN+ybX56ozUSjt+YGMvpQ8ulrSH38+AQpge0XY8jZ4tGCogSdQ3UCDxr3F NUpA1thQYlVcwVunhYd6j/0uFGB+nkaUzTg8BY9UzRHDJORdjS3hIjf9SHPnpc8sQD/C FIHQ== X-Forwarded-Encrypted: i=1; AJvYcCWz0lyc2utGnI7ZPExioQU+8C03EqsrKaYYGYP4geK8YeYGVZEsvUIFUVY5iLB1nwlTHcg8eZsz2xeIA4dp66AhVK6FcjC4UKCGe3pa X-Gm-Message-State: AOJu0Yz4hcbi/nPTqZYdWZ180uYb8yzungDMx0m+RwV953aWnsCDsSPC g9RbeHy1EutptiFQDAMX4fXgINSAwvr/u6r+prcABc5dslF+CnMqvxWJCQKujnA= X-Received: by 2002:a05:6870:3753:b0:229:f403:136e with SMTP id a19-20020a056870375300b00229f403136emr13014545oak.56.1712678567546; Tue, 09 Apr 2024 09:02:47 -0700 (PDT) Received: from localhost ([2620:10d:c091:400::5:6db8]) by smtp.gmail.com with ESMTPSA id i10-20020ac871ca000000b00434af976d2dsm1785597qtp.88.2024.04.09.09.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 09:02:46 -0700 (PDT) Date: Tue, 9 Apr 2024 12:02:41 -0400 From: Johannes Weiner To: Tejun Heo Cc: Michal =?iso-8859-1?Q?Koutn=FD?= , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Zefan Li , Jonathan Corbet , Shuah Khan Subject: Re: [RFC PATCH v3 2/9] cgroup/pids: Separate semantics of pids.events related to pids.max Message-ID: <20240409160241.GC1057805@cmpxchg.org> References: <20240405170548.15234-1-mkoutny@suse.com> <20240405170548.15234-3-mkoutny@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Apr 08, 2024 at 07:55:38AM -1000, Tejun Heo wrote: > Hello, > > On Fri, Apr 05, 2024 at 07:05:41PM +0200, Michal Koutn? wrote: > > Currently, when pids.max limit is breached in the hierarchy, the event > > is counted and reported in the cgroup where the forking task resides. > > > > This decouples the limit and the notification caused by the limit making > > it hard to detect when the actual limit was effected. > > > > Let's introduce new events: > > max > > The number of times the limit of the cgroup was hit. > > > > max.imposed > > The number of times fork failed in the cgroup because of self > > or ancestor limit. > > The whole series make sense to me. I'm not sure about max.imposed field > name. Maybe a name which clearly signfies rejection of forks would be > clearer? Johannes, what do you think? The max event at the level where the limit is set (and up, for hierarchical accounting) makes sense to me. max.imposed is conceptually not entirely unprecedented, but something we've tried to avoid. Usually the idea is that events correspond to specific cgroup limitations at that level. Failures due to constraints higher up could be from anything, including system-level shortages. IOW, events are supposed to be more about "how many times did this limit here trigger", and less about "how many times did something happen to the tasks local to this group". It's a bit arbitrary and not perfectly followed everywhere, but I think there is value in trying to maintain that distinction, so that somebody looking at those files doesn't have to rack their brains or look up every counter in the docs to figure out what it's tracking. It's at least true for the misc controller, and for most of memcg - with the weird exception of the swap.max events which we've tried to fix before... For "things that are happening to the tasks in this group", would it make more sense to have an e.g. pids.stat::forkfail instead? (Or just not have that event at all? I'm not sure if it's actually needed or whether you kept it only to maintain some form of the information that is currently provided by the pr_info()).