Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp710397lqh; Thu, 28 Mar 2024 14:01:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkNOFQ8LJ3HDfLQfGXU3wH3bqpHh4iEoyVvotrzxviqgCwKCF/cwXvr5rjlN53WEQ5Eq2/GWKjcxBzqhNuarEyFKgMlBk4Dhgtjxd+Sg== X-Google-Smtp-Source: AGHT+IG2sB/8E+A37vGBhfejou9o+6bDnIn/8x9ua+djLMrf3QbX8AeS++6HcGzpWAob14QFYRM8 X-Received: by 2002:a05:620a:4d7:b0:78a:45dd:f726 with SMTP id 23-20020a05620a04d700b0078a45ddf726mr661980qks.11.1711659717128; Thu, 28 Mar 2024 14:01:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711659717; cv=pass; d=google.com; s=arc-20160816; b=wpSaa/mrFtMk32NnpL3MlQGH/9cg8s7SWYGPwcsJ24jb3NnEZLYu2Hev///zAlu0zd 1vO24VJ8fQj2+pAj4LI0HsdLBKKGjzCOLA6sEFx4vGPYg+88F2v3qNMrcNd2UlGvvOy5 FLsMQzmzI9WqoWNb3qLa15z7SGLurnRTOhwgGoQa+S1OH56nu8xOpMAavE3DOQX95ctu rBosA7p9PsWA6/pJwJFxuxvAXNIZsSA2VpDI68zKUAD3j617UV4/c8vgsMiLPm+1F5xT OgHnYWNZmsE5MBAWh2lWmAArWRjq6fp8A87H7AemtvShY/SpinIltgN1+VxC/+SB7iSw /38w== 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:sender:dkim-signature; bh=/FNyl55tfISP45Qb1FNPiZF/QfWTZ3G4NafnyQYe208=; fh=VNXhgUUG3yKtlCb6GmAkR1wDNUbhrviZswu61+hb3Qo=; b=U4y01k8pQDNtYuBE7YpjWqFVihuih6juSMYY5vPzGcv3aK///raQkxe3Zt991wNkpS CnWyful3kStUcpymZcYyUGXEXHidpZri8fw375b2srDssJNr2euGy59iH8LdE0fDQ2VY jM646Ie3G7ZMaQ59h/RM6mNZ93AiRBCUZor+LWH0bPIzm1ewQ1YRhFdEr5tXyG1Qd5p9 BC99PZ8jr+srNrj9sktBCRqmloRiC+ZcoZf5ce0ZuQqsFAErI05KqXl0KViJWhljFURA ATURnR9tFKIEBurStLU1Jr1Rww7LnqluTM9o21YhMknyA3Netylw8My1uCl8pCYLd5uX VlmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kF+30EyO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123643-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123643-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 a24-20020a05620a103800b00789ec484c6fsi2311212qkk.121.2024.03.28.14.01.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 14:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123643-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=kF+30EyO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123643-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123643-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 35B221C22427 for ; Thu, 28 Mar 2024 21:01:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97C5713AD3C; Thu, 28 Mar 2024 21:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kF+30EyO" Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.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 534E913A414; Thu, 28 Mar 2024 21:01:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711659674; cv=none; b=h9tjD4iRGRY+wL5Uokr+UK4T9VLTnwPdnETItM8E7SK5/wweBwlHuw1OXUoCr8Su32pQDNwLbvgmtIZkDO0lzXE/u4epW2lAyBQdUJkHWEZTIKgZdWP4FGy5ue+4sYJFpCFyI6UAxuuV7s4HLXcMo9yoXLJg+yQ3ZdNsmsYkoOs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711659674; c=relaxed/simple; bh=6EIK241Ui/y2XCBHEO8y8eUM8zcKfmxY/XDTXZw8QtA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KiE8ceyKMOXsEED/UdNd+RNGyQjb9z/6AK2N3Bnh8ZnO+jPOjFyx4QGHkOl2fqwYoNj7/9wLIJfWZgGIfQ8JrJXNuBUGweyq3JOuMYdMBETq3ud1sobeF/kk5yDcPAztWA3zVg7m5F/xRaZQP4LNcaGzQ8c34/X2gmSSNyG/ynY= 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=kF+30EyO; arc=none smtp.client-ip=209.85.216.51 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-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2a21330d093so85259a91.2; Thu, 28 Mar 2024 14:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711659673; x=1712264473; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=/FNyl55tfISP45Qb1FNPiZF/QfWTZ3G4NafnyQYe208=; b=kF+30EyOFV5Kfxj6zCl9kGhdz756kIVmILUJkmiHM9/Geijukz2yQCmuahHpegHv68 yPWuT/+G0fdiCKq2mtKyKtRH10kQthtfe+WG0kNzxzBHQxSa5tSwMbKDi/YrpKOPFoAR tGuB0Ka3UimPDMCnCpubLOUd7Z6vjC5eKVqrTDebYi/5DWde53za1G3csoIw9TfxuTz0 ZZkHqbgOxOuCMZ9rSCdljVzdVpC/87Gz9IhuBvFTiBPljYOImeDOiOnVWxAMswOoCGjJ oPEmI4DZAmW9QPmjIYs92zGXS6OSTBsUR1Aa+Vnp5TRD4szYsnsiZDhqQGhxVkag3yuM FuZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711659673; x=1712264473; h=in-reply-to:content-transfer-encoding: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=/FNyl55tfISP45Qb1FNPiZF/QfWTZ3G4NafnyQYe208=; b=hpfsp5i/xXrHbowc0nad4arCp26BRxa56xpIYW+uLjcNAIfbaulfxstjT1BsikwTQS ghhuiwD2MUJgK/szVsudY/KRvMyD2cNRYtoug57SmjAnxn8TKouQqBLE7YS+/EfMoTsJ 8Rkyv6glZvRaAIyouGxI/Gwr0nxc4fmR3gyMmWrI1STZDM9U7DKKtKqDVHNk0VzG6eRL qBROsuaxuw59WDmMojB/E6BG3h2u7UB6N6XWSxmoJBZv3EAHyUXUbseN1npOLFGSYs07 Hz86/X+QbkvjBYN/5QCILYMQVJB5APprZjz/B32Lq87e2Dp4fMwA+HjCFeCvq9siK7kU 5MHQ== X-Forwarded-Encrypted: i=1; AJvYcCX/RQVKhRgS0htXoa1rHMg3V4LSeN/iOeRxKwkASoGC78cdTbZ465USc7V9MapWQmI6ap4zLYrgLKdN0VvLyERp5ZfgI13EkOrGVECgRQ4K1iM9x4mozdc3iOGLmWujpFGgfykZEcBIyVW8gHKgaC6JduypqkwWdrKK3hywDIf7iwBVeUIeEOlwNkPnqnMPdrArdxSTjnMlxf7b9g== X-Gm-Message-State: AOJu0Yx04GxDqGAsroeHBx6JzmrrMGgi/yUDApGHnUl80VpoBEsROTKd dD92cdaaTpwRWKiWbFOYJi6/yQx5erzmoSOkdQ1VlcTSl/QBVPsOcysc+3T8 X-Received: by 2002:a17:90a:ead0:b0:2a0:7815:dd25 with SMTP id ev16-20020a17090aead000b002a07815dd25mr669620pjb.20.1711659672552; Thu, 28 Mar 2024 14:01:12 -0700 (PDT) Received: from localhost (dhcp-141-239-158-86.hawaiiantel.net. [141.239.158.86]) by smtp.gmail.com with ESMTPSA id x14-20020a170902a38e00b001e0b25731easm2108379pla.98.2024.03.28.14.01.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 14:01:12 -0700 (PDT) Sender: Tejun Heo Date: Thu, 28 Mar 2024 11:01:10 -1000 From: Tejun Heo To: Alexei Starovoitov 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" 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Hello, On Thu, Mar 28, 2024 at 01:45:56PM -0700, Alexei Starovoitov wrote: > On Thu, Mar 28, 2024 at 1:02 PM 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 adding > > 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. Would it matter? If the user has root perm, they can do whatever with the files anyway, so I'm not sure why we'd restrict any specific knob. Maybe we wanna make sure @filename doesn't include '/'? Or is it that you don't want to go through the usual file name look up? > 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. That all sound good. Thanks. -- tejun