Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp704630lqh; Thu, 28 Mar 2024 13:47:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXSQv1coocspHOuCuB8Ivicr62DGqYD1OEh7KXAw0+gwexHLU38OoIZ2B12qg6ZWMGoiyI2khgh+yyX8KSdQ7IQsTbpSKPmNjYMtB9iMA== X-Google-Smtp-Source: AGHT+IEp396r/o5j7T3SceOKEKc8rStbvDvd4yAf1oxCoxedydHvpPXU6O2RsgPybNUwDmqfGHUc X-Received: by 2002:a05:6214:4c07:b0:696:4c88:e02b with SMTP id qh7-20020a0562144c0700b006964c88e02bmr300955qvb.58.1711658858022; Thu, 28 Mar 2024 13:47:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711658858; cv=pass; d=google.com; s=arc-20160816; b=NcAJsEnP3aT0/w4wW1SQPgijxJ++HUTxo1SYuwbJITPx2aiQIbdCVOo6zItjn2SVJq FHZSr18vbD7XsOfVaXpKHY5Nt2trnRz8PmKnBKreCjpR3Jm1A1hnJhRZFZuuECFZG44h DSI6Ep1bq5qkO1ngOYCc8yO+M+KPx7qmlI42dcjqr7AQYTXl5on2titiGeqjd53zCY/x gFhT9beiN+m6895ZxHKLTT23p0gXl+PW/qoieMNBI+sq7ODF5VauBZ47MpWAbu6l3h7W i/WQ4giOySzj78ljW1LuLOv4HPnCT3XlllRfuaQW7sprTrSjha95SfzL1K7zbo2XTMLZ k1Lw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=9ROvuikQjjjOim6lRPo+vqju8xmCENbq2GpP5H9zg3o=; fh=8ee0zuldxjSkKP8HLft4QdHutz5Jnzp1q1a/n1bRqWY=; b=KsSiyVpLhF/msWMd4G8HdhqWfP/8EAE7FaG8OGeJ/GoFLlM5Mm62EjgpTx6qlRXNZn cuMaEj2yE5h0bFxcMrlMuKCxInU3J7HbA2ZNpYn4mmA9F56u5nthH9S8ZXJ+4RbzUIXm ragzGqS1Jx/ybrM5VkfGqcDa391b46c1C6JnI9Zb6WpRwQj9vVvjqUF6bGMFqlwo+WwN Ga0tk0Lb+0yOsYyMElJqSYk2bsPtCkf8eqo6RfVU0Lv/m9CA0jNyNneV91YIfD4g4Vsy 7rlPM7xVTKMcZ5iEx62ETjfRLr83tKWwuMjCA5CoSTP4eys8Ct14RMJVYcTQjzuy2/rl IyAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=W4tuN2qn; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123623-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g15-20020a0cf84f000000b006915b8ba4a8si2253532qvo.90.2024.03.28.13.47.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 13:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123623-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=@gmail.com header.s=20230601 header.b=W4tuN2qn; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123623-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 BC5E31C310A1 for ; Thu, 28 Mar 2024 20:47:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E7BB13AA2D; Thu, 28 Mar 2024 20:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W4tuN2qn" Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 1A7BB13A3E7; Thu, 28 Mar 2024 20:46:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711658772; cv=none; b=iA/3QnWjN30PkgFgcAZc9RpgljPGMThRoc6JLVSM/V/Yu6JjdxQfhekFPchjRW2Mzeqd94E0EGsdDCdxxih2x59JSZO7RgBKq+TwCuDzMv8rzXaQ/TyUlbknfUuGN4CqP/gEtV4KcATWi27Xh1mgrtwmEpMn0lStELtgNgdkt4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711658772; c=relaxed/simple; bh=g3FUs8oSA+rki3KtzU+fASuzzmwuKLMhOPJ3dRUzwlU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZkgSIl28DJUCjbU8/0GJwKVtAKcKLQUckzNezg4tX+JiqREPPXEpVDjQyfl4EpraBTqdP0qUZc07MFx9CyK2GMZ4PG0wbJkyHajkiMVQrFTocqY3w+/xWgpkwIkEZx3mFIaSMrTEPWL+bAAZhT2ZQMTl5NE20VKE4AMmJBFVkRc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W4tuN2qn; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-41490d05bafso13294255e9.1; Thu, 28 Mar 2024 13:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711658768; x=1712263568; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9ROvuikQjjjOim6lRPo+vqju8xmCENbq2GpP5H9zg3o=; b=W4tuN2qnTVuTlk1gl0o+5Sm9HUTDaAiyXbfV3E9yDoC60Sjc5feRAZCYFNz20KV+F4 5S82L+jlDesZkqE2GfZHTW7/ZrtMjcwXF1s513j5Pt2HXGPjanulJ0PrJaougvETHAAp S7Cb4f/li0Rm/DRJFgp3KtGa6lNgjgFxikZqMvd3Jp5/lhRYW8qs9mFYh29g0912jIex 23CFBcwSQxJ2QzhuXxGyAFDejd3CC9m9sHlbyaaIE8H65c7KRoN0i8UcSF4/pKwBK9v5 vGSBNtX3+zLXjTTLXxFZUFGgA3znCTAroeIZh8zxvGJOGqBRw7mQ+kfx0LV1dXrhYU+v fQdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711658768; x=1712263568; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9ROvuikQjjjOim6lRPo+vqju8xmCENbq2GpP5H9zg3o=; b=C5VQuflX/7GPLEyc21P9EIjHUZVIxqHV+LH2J5euEyz29bEmOw1X2z1l7FwnJnqAJK GW2RC4RJwdDd4fgqfY5fGhDIEkjcsR9wZnkfKjbjCA7f6hHTu3u4MQLRVJNbYhdOmNW0 QGEW9Dh3FPyFayjhlmfFZNvHGRm3wsmmxxps61lr0wuLo9krgG8N3cD1TODVdHrRpzTO kPeUVlfSuEg7LYUZk6V5c0zWwNonN8EvnlPajGwMSu0jmqkzgLdV5NNoX21KmWlBTz7I yROQoNT/hLTv1LD/Xat29PpZEalahJoBTO+UJ6j/R1rRo7AxaP0egoXKYXUQ8Tki/pu4 8AxQ== X-Forwarded-Encrypted: i=1; AJvYcCV78ueAH2EI/SgQGE5xd83EvYD+tpAj5Zr4Qe8vUuCAtbRi3Al4RSxw6lTTFzrr9immA+pSlQLKs/6tCrRdndcLIfwSKJ337dz2iu447hOOSwzVdQyLOwv3+8F+VgIiUy3GLh4d5SNRQEvovkHVNT5c1drx1cxrcvfe2WzgMP7fr0ggPedOeLtuF6M636Mh8e3npWBVhVxMqSOYVg== X-Gm-Message-State: AOJu0Yzpz59GCCAcB1SiaCK1FYYwemXHHzc3yLzDHud5vd4WThSWWiGg r9CwqF4gvzQY2joDLtwMUO2CMnTqltlCnt3gfdmr5/x0jO7sfNI/5ysujiDDFV04C6uXf3Fb4WN 7aZobszuuQh2xUMJVhQ4Um80uEm8= X-Received: by 2002:a05:600c:19c6:b0:414:9455:85e with SMTP id u6-20020a05600c19c600b004149455085emr410145wmq.25.1711658768259; Thu, 28 Mar 2024 13:46:08 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240327-ccb56fc7a6e80136db80876c@djalal> <20240327225334.58474-1-tixxdz@gmail.com> In-Reply-To: From: Alexei Starovoitov Date: Thu, 28 Mar 2024 13:45:56 -0700 Message-ID: Subject: Re: [RFC PATCH bpf-next 0/3] bpf: freeze a task cgroup from bpf To: Tejun Heo Cc: Djalal Harouni , 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 , LKML , "open list:CONTROL GROUP (CGROUP)" , bpf , "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 28, 2024 at 1:02=E2=80=AFPM Tejun Heo wrote: > > There's also cgroup.kill which would be useful for similar use cases. We = can > add interface for both but idk. Let's say we have something like the > following (pardon the bad naming): > > bpf_cgroup_knob_write(struct cgroup *cgrp, char *filename, char *buf) > > Would that work? I'm not necessarily in love with the idea or against add= ing > separate helpers but the duplication still bothers me a bit. I liked it. So filename will be one of cgroup_base_files[].name ? We probably don't want psi or cgroup1_base_files in there. From the verifier pov 2nd arg can be "char *knob__str" and the verifier will make sure it's a constant NULL terminated string, so at runtime it will be easier to search cgroup_base_files array. And 'buf' can be: void *mem, int mem__sz with kfunc doing run-time validation that there a null there.