Re: Re: [PATCH v9 15/15] selftests/sgx: Add scripts for EPC cgroup testing
On Tue, 02 Apr 2024 12:40:03 -0500, Michal Koutný 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 stuff. All we needed were creating/deleting cgroups and set limits which I think have been demonstrated feasible in the ash scripts now. I assume you refer to Message-Id: <20240331174442.51019-1-haitao.hu...@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) Yes, Thanks for the suggestion. Haitao
Re: Re: [PATCH v9 15/15] selftests/sgx: Add scripts for EPC cgroup testing
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 stuff. > All we needed were creating/deleting cgroups and set limits which I think > have been demonstrated feasible in the ash scripts now. I assume you refer to Message-Id: <20240331174442.51019-1-haitao.hu...@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) Thanks, Michal signature.asc Description: PGP signature
Re: Re: [PATCH v9 15/15] selftests/sgx: Add scripts for EPC cgroup testing
Hello. On Sat, Mar 30, 2024 at 01:26:08PM +0200, Jarkko Sakkinen wrote: > > > It'd be more complicated and less readable to do all the stuff without > > > the > > > cgroup-tools, esp cgexec. I checked dependency, cgroup-tools only depends > > > > > > on libc so I hope this would not cause too much inconvenience. > > > > As per cgroup-tools, please prove this. It makes the job for more > > complicated *for you* and you are making the job more complicated > > to every possible person in the planet running any kernel QA. > > > > I weight the latter more than the former. And it is exactly the > > reason why we did custom user space kselftest in the first place. > > Let's keep the tradition. All I can say is that kselftest is > > unfinished in its current form. > > > > What is "esp cgexec"? > > Also in kselftest we don't drive ultimate simplicity, we drive > efficient CI/QA. By open coding something like subset of > cgroup-tools needed to run the test you also help us later > on to backtrack the kernel changes. With cgroups-tools you > would have to use strace to get the same info. FWIW, see also functions in tools/testing/selftests/cgroup/cgroup_util.{h,c}. They likely cover what you need already -- if the tests are in C. (I admit that stuff in tools/testing/selftests/cgroup/ is best understood with strace.) HTH, Michal signature.asc Description: PGP signature