From: Sinadin Shan <sinadin.shan@oracle.com>
To: Chris Hyser <chris.hyser@oracle.com>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
"shuah@kernel.org" <shuah@kernel.org>
Cc: "linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] selftests: sched: skip cs_prctl_test for systems with core scheduling disabled
Date: Tue, 25 Feb 2025 14:24:52 +0530 [thread overview]
Message-ID: <35a53d53-5144-4a3d-9f59-beb84835eb3b@oracle.com> (raw)
In-Reply-To: <SA2PR10MB47149CA0B28DBAC122A960E29BC02@SA2PR10MB4714.namprd10.prod.outlook.com>
On 25-02-2025 04:32 am, Chris Hyser wrote:
>> From: Sinadin Shan <sinadin.shan@oracle.com>
>> Sent: Monday, February 24, 2025 7:10 AM
>> To: Shrikanth Hegde; shuah@kernel.org
>> Cc: linux-kselftest@vger.kernel.org; linux-kernel@vger.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");
> }
>
Thanks for the suggestion Chris, this indeed would be a better method
and also fit in well with the development workflow. I'll give this a try
and send out the updated patch soon.
Regards,
Shan
> -chrish
prev parent reply other threads:[~2025-02-25 8:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 11:57 [PATCH v2 0/2] selftests: sched: Add default target support for sched Sinadin Shan
2025-02-21 11:57 ` [PATCH v2 1/2] selftests: sched: add sched as a default selftest target Sinadin Shan
2025-02-21 11:57 ` [PATCH v2 2/2] selftests: sched: skip cs_prctl_test for systems with core scheduling disabled Sinadin Shan
2025-02-24 8:19 ` Shrikanth Hegde
2025-02-24 12:10 ` Sinadin Shan
2025-02-24 23:02 ` Chris Hyser
2025-02-25 8:54 ` Sinadin Shan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35a53d53-5144-4a3d-9f59-beb84835eb3b@oracle.com \
--to=sinadin.shan@oracle.com \
--cc=chris.hyser@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=sshegde@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox