Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid infinite sem-speed-test #324

Merged
merged 1 commit into from
Dec 30, 2019

Conversation

jphickey
Copy link
Contributor

Describe the contribution

Fix #323

  1. Add a hard limit to the execution (work) counter for the sem-speed-test worker threads. With this they will self-exit eventually even if the root task never gets CPU time to stop them.

  2. Set the priority of the worker tasks to be logically lower, so it is less likely to preempt the main task.

Note that the logical priority is inverted from the numeric value.

Testing performed
Execute unit tests on RTEMS and native (posix/x86-64) and confirm successful operation of the sem-speed-test on both platforms.

Example output from running in RTEMS:

[BEGIN] 01 SemSpeedTest
[ PASS] 01.001 sem-speed-test.c:163 - Sem 1 create Id=196609 Rc=0
[ PASS] 01.002 sem-speed-test.c:165 - Sem 2 create Id=196610 Rc=0
[ PASS] 01.003 sem-speed-test.c:171 - Task 1 create Id=65537 Rc=0
[ PASS] 01.004 sem-speed-test.c:174 - Task 2 create Id=65538 Rc=0
Starting task 1
Starting task 2
[ PASS] 01.005 sem-speed-test.c:198 - Task 1 delete Rc=0
[ PASS] 01.006 sem-speed-test.c:201 - Task 2 delete Rc=0
[ PASS] 01.007 sem-speed-test.c:204 - Sem 1 delete Rc=0
[ PASS] 01.008 sem-speed-test.c:206 - Sem 2 delete Rc=0
[ PASS] 01.009 sem-speed-test.c:210 - Task 1 work counter = 983799
[ PASS] 01.010 sem-speed-test.c:211 - Task 2 work counter = 983798
[  END] 01 SemSpeedTest         TOTAL::10    PASS::10    FAIL::0      MIR::0      TSF::0      N/A::0   

Expected behavior changes
The test completes normally and does not run infinitely.

System(s) tested on:
Ubuntu 18.04 LTS 64-bit (native, build host)
RTEMS 4.11 on i686 (QEMU)

Contributor Info
Joseph Hickey, Vantage Systems, Inc.

Community contributors
You must attach a signed CLA (required for acceptance) or reference one already submitted

1. Add a hard limit to the execution (work) counter for the
sem-speed-test worker threads.  With this they will self-exit
eventually even if the root task never gets CPU time to stop them.

2. Set the priority of the worker tasks to be logically lower, so
it is less likely to preempt the main task.

Note that the logical priority is inverted from the numeric value.
@skliper skliper added the CCB:Approved Indicates code review and approval by community CCB label Dec 18, 2019
@skliper skliper added this to the 5.1.0 milestone Dec 18, 2019
@skliper
Copy link
Contributor

skliper commented Dec 18, 2019

CCB 20191218 - Reviewed and approved for IC

@skliper skliper changed the base branch from master to merge-20191230 December 30, 2019 21:40
@skliper skliper merged commit e8a1db7 into nasa:merge-20191230 Dec 30, 2019
skliper added a commit that referenced this pull request Dec 30, 2019
Fix #295, #298, #305, #307, #308,
    #313, #314, #316, #321, #323
Reviewed and approved at 2019-12-18 CCB
@jphickey jphickey deleted the fix-323-sem-speed-priority branch February 13, 2020 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants