summaryrefslogtreecommitdiffstats
path: root/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_block_case1.scen
blob: 694da1d6209ab876cf976bca463fa5ed2780556c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
#  Block a thread in an application with thread affinity and 
#  priorities such that finding an heir requires scanning the
#  ready set of threads.
#
#  Basic premise:
#    - Two threads at low priority, affinity for core 0
#    - More threads than core at high priority, affinity for all but core 0
#
rtems_init 4
task_create smp1 -a 0xe 10
task_create smp2 -a 0xe 10
task_create smp3 -a 0xe 10
task_create smp4 -a 0xe 10
# GOAL: Core 0 should be idle
# GOAL: Cores 1-3 should be 0x0a01000[321] respectively
cpus IDLE smp3 smp2 smp1

# check_tasks IDLE smp3 smp2 smp1
# GOAL: Core 0 should have aff1 0x0a010005
# GOAL: Cores 1-3 should be 0x0a01000[321] respectively
task_create aff1 -a 0x1 11
cpus aff1 smp3 smp2 smp1

# Create a low priority task with affinity to core 0
task_create aff2 -a 0x1 11
cpus aff1 smp3 smp2 smp1
task_suspend aff1
cpus aff2 smp3 smp2 smp1