Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp595159lqh; Thu, 28 Mar 2024 10:22:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPAIc0r9eaMHMeNINR0EQ0czFLS58m3j4FMl0CNzKyx4OTdHqaBc0hDYtpVTxSL5joxGWaYr5ltDA6fLR+BxXa3LaX8jfYC7MLUme+mg== X-Google-Smtp-Source: AGHT+IH9t5B89HX6PQN5Q4UmF0HhKpgzK/nZIP5/wKcPU3gRq3CwDXJThzgI9sekuwcBLVMgrWOO X-Received: by 2002:ac2:5bcd:0:b0:513:27a1:24cb with SMTP id u13-20020ac25bcd000000b0051327a124cbmr41053lfn.51.1711646551904; Thu, 28 Mar 2024 10:22:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711646551; cv=pass; d=google.com; s=arc-20160816; b=TK9YPW5YNd6Y3hBihSzhcMpi0/E52rrd7vlTWpuFMZBkXQpkqGitejcde0t5kBF1b3 xachckzJd+ojWTBYi9TRNWr5G4T2xCKQD2MOaGmaYLMuCrDb9vtTGL5hQrhWIphKcDcS YZ0yei7OpNNIyl5CrTipVpMDw4G22lD0cBS47nr2L1TdZBGzAOTQAm/95PTKTlHELsS9 uz6bJatcyD/KFkgyjahnq/FAAXkeV1LHltvxCusM4qP61+P/Cv86Ag2wihA+cGhgnPeK 6uDLSUT3d/ilgXBmyB6zMmpElRbNnvwy4sL21DPG+gDW0HLRXDQD/mx7HYFffszSeGV4 A2QQ== 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:sender:dkim-signature; bh=nJTs2T19ZBiaUU6XEnV+BuULbMh1YwOJefd/Q2W0TsI=; fh=yIVcs3E7znhWJQ6lwUHOI5jtgGevQh0FvVsptSv8ASI=; b=hwbGC7/mzIYKjU+AS339EpxoCoSckIDZ14eEejW4Zgma9tPufpmnC51XUfTFJwW2w9 aINb5SlZaXxj/S+qRNvufO8YAXWsJQORHICwqa3ny7c9y3GFKFw2DRw/VhbMqORDnLx1 QYXqyX0+63ZRvo86gLjn5GUJBnS02eaYqZruI+qn4unlIedJI1x6mqOjXXIKi+Rnu1E6 tNEGxxqqD90y+ZNz1/sHzXSd082Fs77UWKSR6X9P9tFDCMTlPXy3sT1pt0AIgDZVGGJW dl4AIHsTOBbBavsBf+FHk3OQ7jpUqV9VTDZtfKT40zkMdo5helDpMvG4luFREvIKMqL+ agiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VKf6inN+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id er23-20020a056402449700b0056bdd1184edsi964055edb.483.2024.03.28.10.22.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 10:22:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VKf6inN+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id DFAE41F2944F for ; Thu, 28 Mar 2024 17:22:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B3447FBBA; Thu, 28 Mar 2024 17:22:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VKf6inN+" Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 52BAC1EA6E; Thu, 28 Mar 2024 17:22:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711646529; cv=none; b=AFH25Fscp9VGig1Gx2XgwrwQSarjjVg/Z5LyBRpjd6+Hr8DyI7AaQH+74XTqRsI8YO/7wkjJMeVZwQ32HKiBFYFHZ78ESD4chF+eldF9pchOo3oJfMs2DjqRQbw2uNMm2TYO9hdWQnJIgZmWg2QoNaEBCrpfLIlyMfxrAiWYzg4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711646529; c=relaxed/simple; bh=rTVGMrfwkd+NlU1R9C/m47OpxkWT83eOW/pXXryVqcc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Bn1D9TmIHPigIqj7jeFQTHTsyDewiFVSX8Pbo64Q7ueSUc+0FtCPyub0W1tMwGMLxOED0wfqXpIoG9sp8nYgylzwdvUCW402yUNqZUgyM1anZCAyD/iCSxjY2ShwJHyKuBXYQG2rQ0wxxQuWuotgzloFiYTVbA57u4AjVqXENXg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VKf6inN+; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6e6b54a28d0so989242b3a.2; Thu, 28 Mar 2024 10:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711646528; x=1712251328; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=nJTs2T19ZBiaUU6XEnV+BuULbMh1YwOJefd/Q2W0TsI=; b=VKf6inN+ywJknsS50jG5870ZVt4uTBvXS/YhJyDKGoRxb+cTmts+c1EChjZ7LUhC/a zmREgWU4OwDxm+NMG7HMPS18CGK2v/KxxSG3LyEiIqCChWFFsdMXPKl0rgufFVmWR6AO 3H8jVYKeZeISLiUR4KLIqw5NNk/DYt1oA41RjU3Q4eVRSTLReLoGtDp7/vsbMTKmTwAP etycr06zN/jR2XX9aK0K88BbndPVBvYpmxQMxhD60poZs7O+raLG65zJ6dKYL1bR0G5R VoDfufXBogD2h1nQxHlXOrHpVGHgRu12dGfZzsQANl/pvOkdrb/V2pj/JEoJlpt0tklK xFgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711646528; x=1712251328; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nJTs2T19ZBiaUU6XEnV+BuULbMh1YwOJefd/Q2W0TsI=; b=OcwKIC0YMI/ocLQtGKL+/2pBIlo3z1WNB9URjWt51mjYZS3j5MB+ahiqzRIR9HtFQx 1K3kFQ71MuiutBSYhIenPBjYotAnPga8PXSuE0ZxSvKpvVORC5wEFVbTyJ5ZxC1Jc+PL +Dz1ACp8LunyAnnDjJb9kIhEpQGgyBBVBFbHhoBXuD8qvSVNzvTorNOsPRYeLgYvaRTq lPJTvrXRFREN+wiMs2okT66a+3a7nqMihEGqV6MTdXSmO7jf2cm8Py1grB7IlvfXpwjL abxjNHIYp4utYfmqU+XCdAngzpNMQ9RQY6aHtohX4LO4JYC3BaxSyY4U8xwsp7a6o8L3 4WoA== X-Forwarded-Encrypted: i=1; AJvYcCUBSGh/uVwvzYqW7br/GecEyF1ZDcnskdTx9Ia5S3oCd+SAJl7bzAavJ3EEYi3FbvulAzabF41qIHWBv/MrOw3i6UGrbWRVqaPyhsyEFUxCfVkciDeXL+ES9k2Jji6EvRH/ugLoLWHL1vHJ1TR9dxN5ceSTsEw4kquhH3oK5gxkWddIiDkC5y3cPwPy+pbzZbWeLBCmoj6WZEKu6g== X-Gm-Message-State: AOJu0Yy8mGhM1Vp9bXI1qhyQyOIVpmJ0mV/2imvHfaxjI/nnwinEKb5F 42E/yAGQgAqNXUcPD1J4X72Qai8wbehtsrA12IVLH5SzV3qw7G4W X-Received: by 2002:aa7:8893:0:b0:6ea:c4f4:13cc with SMTP id z19-20020aa78893000000b006eac4f413ccmr4333915pfe.26.1711646527638; Thu, 28 Mar 2024 10:22:07 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:4d4e]) by smtp.gmail.com with ESMTPSA id gu5-20020a056a004e4500b006ead4eb1b09sm1619509pfb.124.2024.03.28.10.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 10:22:07 -0700 (PDT) Sender: Tejun Heo Date: Thu, 28 Mar 2024 07:22:05 -1000 From: Tejun Heo To: Djalal Harouni Cc: 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240327225334.58474-1-tixxdz@gmail.com> Hello, Djalal. On Wed, Mar 27, 2024 at 11:53:22PM +0100, Djalal Harouni wrote: > This patch series adds support to freeze the task cgroup hierarchy > that is on a default cgroup v2 without going through kernfs interface. > > 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. > > 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. > > Patch 1: cgroup: add cgroup_freeze_no_kn() to freeze a cgroup from bpf > Patch 2: bpf: add bpf_task_freeze_cgroup() to freeze the cgroup of a task > Patch 3: selftests/bpf: add selftest for bpf_task_freeze_cgroup It bothers me a bit that it's adding a dedicated interface for something which already has a defined userspace interface. Would it be better to have kfunc wrappers for kernel_read() and kernel_write()? Thanks. -- tejun