[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SA2PR10MB47149CA0B28DBAC122A960E29BC02@SA2PR10MB4714.namprd10.prod.outlook.com>
Date: Mon, 24 Feb 2025 23:02:20 +0000
From: Chris Hyser <chris.hyser@...cle.com>
To: Sinadin Shan <sinadin.shan@...cle.com>,
Shrikanth Hegde
<sshegde@...ux.ibm.com>,
"shuah@...nel.org" <shuah@...nel.org>
CC: "linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] selftests: sched: skip cs_prctl_test for systems
with core scheduling disabled
>From: Sinadin Shan <sinadin.shan@...cle.com>
>Sent: Monday, February 24, 2025 7:10 AM
>To: Shrikanth Hegde; shuah@...nel.org
>Cc: linux-kselftest@...r.kernel.org; linux-kernel@...r.kernel.org; Chris Hyser
>Subject: Re: [PATCH v2 2/2] selftests: sched: skip cs_prctl_test for systems with core scheduling disabled
>
>On 24-02-2025 01:49 pm, Shrikanth Hegde wrote:
...
>> If the self-tests are to be used in development flow, these checks may
>> not be sufficient.
>
>Right, this particular case was overlooked. To handle this, the test
>could take a path to the custom config as an argument. I shall work on
>getting this fixed.
I was thinking something along the lines of just calling the prctl.
If you call it and SCHED_CORE is not configured, you will get an EINVAL. Unfortunately,
passing other bad values in the other prctl args will also give an EINVAL, but if you call it with a
non-existent PID (say max_pid + 1) it will generate an ESRCH if the code is present.
So something like (and I'd look up the maxpid on the actual system):
int check_core_sched()
{
ret = prctl(PR_SCHED_CORE, PR_SCHED_CORE_GET, 32769, PIDTYPE_PID,
(unsigned long)&cookie);
printf("ret = %d\n", ret);
perror("Error:\n");
}
-chrish
Powered by blists - more mailing lists