Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp461544lqz; Sat, 30 Mar 2024 04:29:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVAJi/X8KIOeKXLGTKWVLwwjZxAj3Sy07FROdGoYXmfpLBwtfyTnJ0izh6wBs/iCtt6AzRYWLxVobdC3Z+Ua0FwZT5BWyECwve/oIaCsA== X-Google-Smtp-Source: AGHT+IFRXx1mj1kgZ8dvEiKr1PRypslr16c89FEOaNlQ+UVJzCRVss1fse1hkXhoqX+f/PC20xdt X-Received: by 2002:a17:902:a5ca:b0:1de:ee46:ed99 with SMTP id t10-20020a170902a5ca00b001deee46ed99mr4826390plq.61.1711798171456; Sat, 30 Mar 2024 04:29:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711798171; cv=pass; d=google.com; s=arc-20160816; b=jOrW2TvRTZ6iaHIdEEJKVXNd9fx8Cb+6AgOifoS8IyIkB823AwqRQefmWh8HDIB4ZB G19fDlv2XyaJKaGcZhyPTwbmksxBxdoKNKZ3dHr48eQM6Ab/tbsmefE3z/SsVZLw4gqV 4R9YHm4SvpnK03kSwAxlJyRG4hC1vZDy4mrMdOMl/bJKKxhlwreEbVHG9qX7rGyXpNRC sZ/z0eydfJyRGuUgJcWjTg1Tk2OKso21ca+uSqSyboDO2lKUn9aE8L+2kzOJrG/hD2rh 17zBz89WeXzIOdPdDEN8rBeVTCryf0A0ZKCMPBR6Cql2vCApQeCmxZ4us9xCgelsgfQD 9LYQ== 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=ZDRpSk5QEK6fSXRjX+8EIE1WqOkqoCeLg1ZosGX387M=; fh=O/HDNTaprEU6+2NekXFHdrqtcw+UHBBY93oZGoG+mUs=; b=X1ZJLitR+s5OLnj5BOEcQhN0pZjXG+QANMRsRLLvduKmWXqq60MaKAmSr4Q9hfFx5A KaF9YwDOVixdfdYGs+rb1yGXntwOvcK02n7RcdXxcw4srt0EfWGGypnS4ABf/0lol8sW cLXCqCv3Yll+t23SDptqFDiKxp54f9RhAXOocAO/3h84SjcHIxO4RyPwzIVGAQYUVxCi C7oR52zMSwucd5/YcbNMOeQxVy5I0PO3AExPDk/BxI4dS593fzCQt8BS2tJJrGsQL/kx OWnkS8wYs10qDBsHC2yOzcnk5OQzMfJLl/0BY6t3tSh+IIGLkpqxFB9C+E0j4CxPvYsd ek7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FQERnMEI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-125699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h2-20020a170902f7c200b001deeb7e00f7si5020282plw.428.2024.03.30.04.29.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 04:29:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FQERnMEI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-125699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125699-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2631C283374 for ; Sat, 30 Mar 2024 11:29:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 372102DF73; Sat, 30 Mar 2024 11:29:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FQERnMEI" 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 4465B847B; Sat, 30 Mar 2024 11:29: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=1711798163; cv=none; b=OWE5QMjiw2JtBzqb2FOg6gmCFN0tWaznEF/Uj08qKlai9VtlcJX3+t0Yu/u8YfpzBqLJ5zBpXiLtVH9gMfZeK8HeR3TYgPwijFRXZoiauJKHvh7vZBQvfHCCY1tXZ2INh3VC5yRWR6Rp2XohzdYhcakCvWTKNgUZ1jMHPY2ZU9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711798163; c=relaxed/simple; bh=+7B/yrGFp37Kx0nQkDUOYGW1RCsXvAn6Vinrds5Ck7U=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=k59iTB/zZ5+mXG8Zj8v2eenYO6go2oSpqqD8ODDMFic7gw8b+oAoliDIvtPOrntrUaJso9FnQcHOe4oSjsw4PBMCr4s6CxEzGqxVp5+loz+DYp/eofkQERw9BlK0Y04Ir9p0F50Sp20RpgrDIg6Rvwx0Irrqc7jcMCFP+6WnfFY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FQERnMEI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 980FBC433C7; Sat, 30 Mar 2024 11:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711798163; bh=+7B/yrGFp37Kx0nQkDUOYGW1RCsXvAn6Vinrds5Ck7U=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=FQERnMEIux1+CObR1szJYJNmA/d8A5k7dAPxpJGXjm1bv5IwW/vLzdmMAu6FiyndL fIGdSA+TShvM1YEc92h441kk58jgGPRK5noalj6Y3flv+O93rllQg8FOEyhMijSP8k BE39KUbFfuLPo3cXpewkOxyaAIy3h1CpSKcKuddiyn93c+N58mZZUa5FGHpqtimSgy rFGq0klYspjuY/dDcdKTEXhB06v52ftojpZGlZqFRCpmrsyx8hSJvPjcVJXGiX9IpH +dym2EGC/In7T61OTdnZeNS4a0dvC2J5q5jFv2YrWBqDfNW3hj1Y22tY5JpjcHzR39 +A+PuApC7vSEg== 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: Sat, 30 Mar 2024 13:29:16 +0200 Message-Id: Cc: , , , , , , , Subject: Re: [PATCH v10 14/14] selftests/sgx: Add scripts for EPC cgroup testing From: "Jarkko Sakkinen" To: "Haitao Huang" , , , , , , , , , , , , , , X-Mailer: aerc 0.17.0 References: <20240328002229.30264-1-haitao.huang@linux.intel.com> <20240328002229.30264-15-haitao.huang@linux.intel.com> In-Reply-To: <20240328002229.30264-15-haitao.huang@linux.intel.com> On Thu Mar 28, 2024 at 2:22 AM EET, Haitao Huang wrote: > The scripts rely on cgroup-tools package from libcgroup [1]. > > To run selftests for epc cgroup: > > sudo ./run_epc_cg_selftests.sh > > To watch misc cgroup 'current' changes during testing, run this in a > separate terminal: > > ./watch_misc_for_tests.sh current > > With different cgroups, the script starts one or multiple concurrent SGX > selftests, each to run one unclobbered_vdso_oversubscribed test. Each > of such test tries to load an enclave of EPC size equal to the EPC > capacity available on the platform. The script checks results against > the expectation set for each cgroup and reports success or failure. > > The script creates 3 different cgroups at the beginning with following > expectations: > > 1) SMALL - intentionally small enough to fail the test loading an > enclave of size equal to the capacity. > 2) LARGE - large enough to run up to 4 concurrent tests but fail some if > more than 4 concurrent tests are run. The script starts 4 expecting at > least one test to pass, and then starts 5 expecting at least one test > to fail. > 3) LARGER - limit is the same as the capacity, large enough to run lots o= f > concurrent tests. The script starts 8 of them and expects all pass. > Then it reruns the same test with one process randomly killed and > usage checked to be zero after all process exit. > > The script also includes a test with low mem_cg limit and LARGE sgx_epc > limit to verify that the RAM used for per-cgroup reclamation is charged > to a proper mem_cg. > > [1] https://github.com/libcgroup/libcgroup/blob/main/README > > Signed-off-by: Haitao Huang My previous comments and you have two undocumented dependencies for your selftest (I searched for cgexec and cgroups-tools as keywords). BR, Jarkko