Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4229768rba; Tue, 2 Apr 2024 10:46:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgofit8kZuUOXWB/ZnroZy8RpC201D/brTulczEvCqaiRSxdAP+7VP6h+3tTZLX//bIC3OR0oIgpFD+h6TchoMGzBHrLDZI5qgw/bLPw== X-Google-Smtp-Source: AGHT+IGGm6CWWOukA5AWdcw/RMUVINzKSvp339OC/LfoTX6DEatHGS45Kvq/YJUvlv85zFUFtdCy X-Received: by 2002:a17:902:d183:b0:1de:f7cf:471 with SMTP id m3-20020a170902d18300b001def7cf0471mr333331plb.69.1712080009975; Tue, 02 Apr 2024 10:46:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712080009; cv=pass; d=google.com; s=arc-20160816; b=VhGq17oNHG8psNcoYQZaTDWA5v6FirOeAq9NDOsO1Xmt8atI3+igKepwreKzpQ4QXk 81TEB5jxxqso2mzPGgwyK8XQoWBKcNmBO45SuMG005H1/SViVy+/ua16eNrlThwsR4tD vae39ExotLNWyGJS3yRYEWPSetk2mPf4Qwy0xwi8Ub+Ydmp7+ICOIgWe77vCAjYy0xbU oT+/SUOFhryN0L2WkcPHGm2u7zcrC/nWcVNCbxhXo4i6hn8uA1nWeWX/ErmpUo+Mrpn/ jys9BQlRgfMn+u5PVr9aDuARTbeSq+Egi19IsMmDktGJAqWHO/pmE83zROyKDqf0qHhc FSEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pP519wusPUAXRys+Pm1fP6WiHUMTu+p8h8uiy+wJCy0=; fh=GN6QLFJWOjJVVxbX+S/qpuX9qM5+4rKN7u0nmvyG5Yk=; b=aIpk/ZVMkUzYXoi3Hk2fDyMA6Vp4Ofs5tug0hQ5aM8yccbP4jmTxYX/qtaNLkqAF8m Jsr+Nfiao70Bb5+2sI2P4VtsCfJcu5ua9PbuQxiqe25bYqg9iDx/YwjcIsh7edlZbUp8 NfzfhEL2VyDWMberVEhT1cBn27Nbk+R5vmtA39m88HldYCGLr17Y1N9iiCMIKFKjHGr/ v0QRw3T5pjQPsAKxqL+SLG5X7uTNQiEHHkSSbP7IRcOkE58ivt+pQC0w6rtoMqaErruE PS06BOSJGYLMIbJr2jRN2lQQkxUkZcelCAPuQZdDHu5OdwIh06YxdSuwJNqNzjQItzoP NMJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=HyDNeoUo; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-128415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m13-20020a170902f64d00b001e23e069565si8297298plg.79.2024.04.02.10.46.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 10:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=HyDNeoUo; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-128415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D892BB2451B for ; Tue, 2 Apr 2024 17:16:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1989715A499; Tue, 2 Apr 2024 17:16:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="HyDNeoUo" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 64E4015990F; Tue, 2 Apr 2024 17:16:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712078202; cv=none; b=KBe1BNEs+p8Utt7UMOp8o9wKunXLsxXXxMrtGtd2FNt1aIKwA6f4exP1Qv4QYg6/ZlpVQuMabfVUeqOBEgcwGvTld5ImhVXtMntLTODt75gEObO7YagF/ILl8UUcRnCAopMtNaeMZcOmi375UiyKXu6oauNh5x/f5IHIaTSFF4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712078202; c=relaxed/simple; bh=pP519wusPUAXRys+Pm1fP6WiHUMTu+p8h8uiy+wJCy0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mhN2ioAM1ciUs4CDbPC5zygsxd3URYjQXuGoz17kk8MorneA35V05UY/BIZ0ItY+fpZQj54EL2Ax2oLat2m0BFIgLLiWIlwHrlyU8pZauhRg9Dp8qFU5nEd2lv9Cdc+G1L2DMVuPX1L9A2fE6KFjj7IE8IRY4zvlK9pljnRBMu4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=HyDNeoUo; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8637B34934; Tue, 2 Apr 2024 17:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1712078198; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pP519wusPUAXRys+Pm1fP6WiHUMTu+p8h8uiy+wJCy0=; b=HyDNeoUoZJkyHWwJ8XCspPVKQE0grsOAe6fIzOJfL6spCvd8yGbYzAefLUZLCRHZcjQuWZ P21owtoIlNmvKSzoFThdyX2PRKtb7ph/zuDKnK7aTsZtPYc5WbgwGy/kozkVocQijFMnGr KxxnZHv5eGwVoSboBVG4imEzEAx39Mk= Authentication-Results: smtp-out1.suse.de; none Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 7240F13357; Tue, 2 Apr 2024 17:16:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id vLDAG3Y9DGZiIgAAn2gu4w (envelope-from ); Tue, 02 Apr 2024 17:16:38 +0000 Date: Tue, 2 Apr 2024 19:16:29 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Djalal Harouni Cc: Tejun Heo , Zefan Li , Johannes Weiner , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH bpf-next 0/3] bpf: freeze a task cgroup from bpf Message-ID: References: <20240327-ccb56fc7a6e80136db80876c@djalal> <20240327225334.58474-1-tixxdz@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jy46jtmbnpyw2njk" Content-Disposition: inline In-Reply-To: <20240327225334.58474-1-tixxdz@gmail.com> X-Spam-Score: -2.01 X-Spamd-Result: default: False [-2.01 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-0.62)[82.04%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.19)[-0.971]; RCPT_COUNT_TWELVE(0.00)[22]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[kernel.org,bytedance.com,cmpxchg.org,iogearbox.net,linux.dev,gmail.com,google.com,fb.com,vger.kernel.org]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Level: X-Spam-Flag: NO --jy46jtmbnpyw2njk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello. On Wed, Mar 27, 2024 at 11:53:22PM +0100, Djalal Harouni wrote: > ... > For some cases we want to freeze the cgroup of a task based on some > signals, doing so from bpf is better than user space which could be > too late. Notice that freezer itself is not immediate -- tasks are frozen as if a signal (kill(2)) was delivered to them (i.e. returning to userspace). What kind of signals (also kill?) are you talking about for illustration? > Planned users of this feature are: tetragon and systemd when freezing > a cgroup hierarchy that could be a K8s pod, container, system service > or a user session. It sounds like the signals are related to a particular process. If so what is it good for to freeze unrelated processes in the same cgroup? I think those answers better clarify why this is needed. As for the generalization to any cgroup attribute (or kernfs). Can this be compared with sysctls -- I see there are helpers to intercept user writes but no helpers to affect sysctl values without an outer writer. What would justify different approaches between kernfs attributes and sysctls (direct writes vs modified writes)? Thanks, Michal --jy46jtmbnpyw2njk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQpEWyjXuwGT2dDBqAGvrMr/1gcjgUCZgw9awAKCRAGvrMr/1gc jkx3AP9q4yObx2ZVhnJrJtyuNXurHxN0CyA34JgyPMSJk2fz8wD/eQvPgsUzvuGS lms51KfenKpEwlwmmEfvlZSNXVAU1Qw= =rjUz -----END PGP SIGNATURE----- --jy46jtmbnpyw2njk--