#3059 closed enhancement (fixed)

Add a simple processor affinity support to the EDF SMP scheduler

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: score Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Add support to the EDF SMP scheduler to honour one-to-one and one-to-all thread processor affinities. Use one ready queue for threads with a one-to-all affinity. Use one ready queue for each of the one-to-one threads for each processor. Since a red-black tree is used for the ready queues, the space overhead of one pointer per ready queue is small.

Change History (28)

comment:1 Changed on Jul 10, 2017 at 7:33:00 AM by Sebastian Huber <sebastian.huber@…>

In fd03ba4/rtems-source-builder:

4.12: Fix and update bitset(9)

Update #3059.

comment:2 Changed on Jul 10, 2017 at 7:37:14 AM by Sebastian Huber <sebastian.huber@…>

In 3dfe55ee/rtems:

score: Use <sys/bitset.h> for Processor_mask

Implement the Processor_mask via <sys/bitset.h>. Provide
_Processor_mask_To_uint32_t() to enable its use in device specific
routines, e.g. interrupt affinity register in an interrupt controller.

Update #3059.

comment:3 Changed on Jul 10, 2017 at 7:37:27 AM by Sebastian Huber <sebastian.huber@…>

In 7a5e4d94/rtems:

score: Add processor mask to/from cpu_set_t

Update #3059.

comment:4 Changed on Jul 10, 2017 at 7:37:38 AM by Sebastian Huber <sebastian.huber@…>

In 6223097a/rtems:

score: Add some processor mask functions

Update #3059.

comment:5 Changed on Jul 10, 2017 at 7:37:51 AM by Sebastian Huber <sebastian.huber@…>

In 7851555/rtems:

score: Move processor affinity to Thread_Control

Update #3059.

comment:6 Changed on Jul 10, 2017 at 7:38:03 AM by Sebastian Huber <sebastian.huber@…>

In 6b1d8c7/rtems:

score: Add processor set to scheduler context

Replace the simple processor count with the processor set owned by the
scheduler instance.

Update #3059.

comment:7 Changed on Jul 10, 2017 at 7:38:15 AM by Sebastian Huber <sebastian.huber@…>

In 1ec9c86/rtems:

rtems: Fix rtems_scheduler_remove_processor()

Account for the thread processor affinity and make sure that it is
possible to allocate a processor to each thread dedicated to a scheduler
instance.

Update #3059.

comment:8 Changed on Jul 10, 2017 at 7:38:28 AM by Sebastian Huber <sebastian.huber@…>

In 0232b28/rtems:

score: Use processor mask for set affinity

Update #3059.

comment:9 Changed on Jul 10, 2017 at 7:38:41 AM by Sebastian Huber <sebastian.huber@…>

In 76d1198/rtems:

score: Introduce _SMP_Get_online_processors()

Update #3059.

comment:10 Changed on Jul 10, 2017 at 7:38:53 AM by Sebastian Huber <sebastian.huber@…>

In 16347a6/rtems:

score: Fix default set affinity

The set of online processors must be a subset of the thread processor
affinity for the schedulers without arbitrary processor affinity support
to avoid problems in case of processor addition and removal.

Update #3059.

comment:11 Changed on Jul 10, 2017 at 7:39:05 AM by Sebastian Huber <sebastian.huber@…>

In 197a614/rtems:

score: Add scheduler node to set affinity op

Update #3059.

comment:12 Changed on Jul 10, 2017 at 7:39:17 AM by Sebastian Huber <sebastian.huber@…>

In e745ec5/rtems:

smptests/smpstrongapa01: Simplify

Update #3059.

comment:13 Changed on Jul 10, 2017 at 7:39:29 AM by Sebastian Huber <sebastian.huber@…>

In d19dc071/rtems:

score: Pass scheduler nodes to processor allocator

This allows scheduler implementations to easily access
scheduler-specific data.

Update #3059.

comment:14 Changed on Jul 10, 2017 at 7:39:41 AM by Sebastian Huber <sebastian.huber@…>

In 34487537/rtems:

score: Add simple affinity support to EDF SMP

Update #3059.

comment:15 Changed on Jul 10, 2017 at 7:39:54 AM by Sebastian Huber <sebastian.huber@…>

In 4a1bdd30/rtems:

score: Fix set scheduler

Ensure that the thread processor affinity fits the new scheduler
instance.

Update #3059.

comment:16 Changed on Jul 10, 2017 at 7:40:06 AM by Sebastian Huber <sebastian.huber@…>

In 21389c06/rtems:

score: Make EDF the default SMP scheduler

The EDF SMP scheduler supports simple thread processor affinities
(see #3059) with a small run-time overhead. The current default SMP
scheduler lacks support for thread processor affinities at all. The EDF
SMP scheduler offers a good feature set for most applications. So, use
it by default. Run-time libraries like libgomp, MTAPI, work stealing
schedulers, language interpreters (e.g. Erlang virtual machine),
maintainence of per-processor data (e.g. Universal Memory Allocator
(UMA)), etc. use a one-to-one thread processor affinity for example.

Update #3063.

comment:17 Changed on Jul 10, 2017 at 7:49:06 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In 9037998/rtems-docs:

c-user: Update scheduler/task chapter

Reflect EDF SMP scheduler changes.

Close #3059.
Close #3063.

comment:18 Changed on Jul 11, 2017 at 11:51:47 AM by Sebastian Huber <sebastian.huber@…>

In 3b14e7aa/rtems:

rtems: Fix warning

Update #3059.

comment:19 Changed on Jul 11, 2017 at 12:16:24 PM by Sebastian Huber <sebastian.huber@…>

In c29eb085/rtems:

bsps/sparc: Fix ambapp_int_set_affinity()

Update #3059.

comment:20 Changed on Jul 12, 2017 at 6:15:29 AM by Sebastian Huber <sebastian.huber@…>

In 8397320/rtems-source-builder:

4.12: Fix bitset(9)

Update #3059.

comment:21 Changed on Jul 12, 2017 at 8:57:27 AM by Sebastian Huber <sebastian.huber@…>

In e2623038/rtems:

score: Fix typo

Update #3059.

comment:22 Changed on Jul 18, 2017 at 12:38:53 PM by Sebastian Huber <sebastian.huber@…>

In 852d7059/rtems:

score: Fix warning

Update #3059.

comment:23 Changed on Jul 19, 2017 at 11:04:31 AM by Sebastian Huber <sebastian.huber@…>

In 96ce1ec/rtems:

smptests/smpscheduler02: Remove invalid assert

Update #3059.

comment:24 Changed on Sep 22, 2017 at 12:24:57 PM by Sebastian Huber <sebastian.huber@…>

In 560acb62/rtems:

score: Include missing header file

Update #3059.

comment:25 Changed on Oct 10, 2017 at 6:27:10 AM by Sebastian Huber

Component: SMPscore

comment:26 Changed on Oct 10, 2017 at 6:29:01 AM by Sebastian Huber

Component: scorecpukit

comment:27 Changed on Nov 7, 2017 at 6:09:28 AM by Sebastian Huber <sebastian.huber@…>

In bceb9db6/rtems:

score: Remove superfluous include

Update #3059.

comment:28 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.