Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2832997lqz; Wed, 3 Apr 2024 09:46:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXg0qfABMiBTqNnWtgto0bzM3SJsmoXYl1EjgUCNbQV4Kr+sldqFz9QayN+4FulH20JhKJH3CCWVYFT0KXiPDBV3KRCw9nHeiKct8Yi7g== X-Google-Smtp-Source: AGHT+IGaEwDOC659qzw0/WJeOVghrQ0wXDr1SiBKxb8XK/P7XPLL9rCt5JkOJ3eDN3SrGYFkBilp X-Received: by 2002:a50:9997:0:b0:56e:12cf:74ee with SMTP id m23-20020a509997000000b0056e12cf74eemr10685edb.15.1712162795523; Wed, 03 Apr 2024 09:46:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712162795; cv=pass; d=google.com; s=arc-20160816; b=pHQKTP/MhPlsWDd9iYWmUM0RKRkqbSkd5lqk8gf5HuQQZHuERXzht0cvx5A3qaS/+8 dk69CISV6MYbAyzE4mN8raOXMvzTqrD1idp2nA39OVwsW7GvlwJ+yeiVlSSeJui5wcFr jUvorNY6pOwHnQHPhPDrFzTN1yXYnxJwWjpLnc4Q3kXKHZrh+abE6a25A45IZ9GQl6Y7 mBpQbKNhrgv/1WmDkF19tP0wGNFgEr+0MJQ8/+lbK4IZWdha1v+Pk2jPKPahqJCq8HcV kUB+pvFKLDgcqLJ0LCFqkOpHzwA6Ls6eKC5gBHkj+8JrG5RYA5dY88EF5oyGtjv426Xj zwWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=jZ61dRd55DuKNI3bPTwh//pVNbsIYRyvoNmZCyRKohI=; fh=xJPfrQR/kbKW4zaDFZ2M8dq1sCt2dWiLeIzEZmi8FDg=; b=kFHTCPFB/5OL49jWxdRLu6MkkpfcrMVdgAviZSwT2/3fj0EGLVmnwAt1C2ImMcMTpE GvkIX94dUVN2VzZH6uLlc+F7GzNzuZelWq4xYx3NvQ5zo7x2xqIITgj8WN6VIPRiTh8c rG/URxNK2x3r+nDxN/RBdqo2dVJnm+40pYAjJOGcqidvreNb/8RLUhgduNITWV9LSNhA pAbqophZqLMsreq633JxDlGSGTtSr0Fz9riu+kA6SKl6/SuJq4VDcsUi6o020XeRNSN8 S2a7d7mmbA1qVfQOxPnyLYNHEwHZ9uERKfr/Q4xRgsjO99/kaQnIA24SbxCP009htbAD lBzw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L4SwTRHj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-130217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130217-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a9-20020a05640213c900b0056e0b8d88f7si579798edx.322.2024.04.03.09.46.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 09:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L4SwTRHj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-130217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130217-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 417351F27226 for ; Wed, 3 Apr 2024 16:46:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E0141514F4; Wed, 3 Apr 2024 16:46:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L4SwTRHj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 813DC1E520; Wed, 3 Apr 2024 16:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712162783; cv=none; b=nTvu22szWk0GasX4wUpfWcSnlR4b4o1IJ5l3nFKFmSkKKw1tSPuGgkPX9vYBRrvHMtBxA4AwipLk1u9K/0qoWrrY2xI3f3vXnT0Wwyt1YkgBA3kNL9DomRtsYie2UYTbN/nK+SGQiasEzXQeuvw+8IF3odNOQoylyLH5UPYjkns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712162783; c=relaxed/simple; bh=B/9drZEy5S7WaOtGfUFnN3ljHMB28vjUwWZEPvQmAzs=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=pxjf9gjmBTR+EV1PEeoSaZiH8xNn9xcTUA23q5ITvk2rF32JuLySrPMtPOSqANRoKJOTiLkmE1nihc5OWfHUI8OG8P1cTM3/ye1k7c5o7hCSZqPhrV+Mkz7vlHLMEoJc9MHmQcGgTarytZLi8nS6H4lVJwYG4k/IrRKtMmk5fUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L4SwTRHj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9D15C433C7; Wed, 3 Apr 2024 16:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712162783; bh=B/9drZEy5S7WaOtGfUFnN3ljHMB28vjUwWZEPvQmAzs=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=L4SwTRHjmdR1/Qm+gnsbFIb+8kkfUzw6rTiDJKE7UPZPxH4gNNm+3sU0kcBkpsx5Z EQNr5evYNvWZ8XDpgCLbsHVpyM07Gwems6ZXP1on/v99RFs7Ra0FLnbo0nTkCohCJc Mi4mIzn7YOoQpadDZ4PCRjHpXpU/0Ar9tFzGm6hQfW9s58dC94hPzojlL3flT6GwAb RIrbkgq9EAVotXFnjJQyInDO+7tggRGZF0erEspN+E1D2wTjRspk7XLF4PKbOUsvzh SX4xMOPMJIS53qRuSqsOwcOOCeN4JvC2PSP9A0BQXHQwsYjc05Fp1eXhE6mmIitsFR 4IDS8uXbgnTQA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 03 Apr 2024 19:46:16 +0300 Message-Id: Cc: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v9 15/15] selftests/sgx: Add scripts for EPC cgroup testing From: "Jarkko Sakkinen" To: =?utf-8?q?Michal_Koutn=C3=BD?= , "Haitao Huang" X-Mailer: aerc 0.17.0 References: <20240205210638.157741-1-haitao.huang@linux.intel.com> <20240205210638.157741-16-haitao.huang@linux.intel.com> <4be7b291010973c203ed8c7bcd25b626c1290231.camel@kernel.org> In-Reply-To: On Tue Apr 2, 2024 at 8:40 PM EEST, Michal Koutn=C3=BD wrote: > On Tue, Apr 02, 2024 at 11:20:21AM -0500, Haitao Huang wrote: > > Do we really want to have it implemented in c? > > I only pointed to the available C boilerplate. > > > There are much fewer lines of > > code in shell scripts. Note we are not really testing basic cgroup stuf= f. > > All we needed were creating/deleting cgroups and set limits which I thi= nk > > have been demonstrated feasible in the ash scripts now. > > I assume you refer to > Message-Id: <20240331174442.51019-1-haitao.huang@linux.intel.com> > right? > > Could it be even simpler if you didn't stick to cgtools APIs and v1 > compatibility? > > Reducing ash_cgexec.sh to something like > echo 0 >$R/$1/cgroup.procs > shift > exec "$@" > (with some small builerplate for $R and previous mkdirs) I already asked about necessity of v1 in some response, and fully support this idea. Then cgexec can simply be a function wrapping along the lines what you proposed. BR, Jarkko