#2797 closed enhancement (fixed)

Add ability to add/remove processors to/from a scheduler instance

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

Description

The scheduler configuration is done at link-time. In order to support run-time re-configuration add functions to dd/remove processors to/from a scheduler instance.

/**
 * @brief Adds a processor the set of processors owned by the scheduler.
 *
 * Must be called from task context.  This operation obtains and releases the
 * objects allocator lock.
 *
 * @param[in] scheduler_id Identifier of the scheduler.
 * @param[in] cpu_index Index of the processor to add.
 *
 * @retval RTEMS_SUCCESSFUL Successful operation.
 * @retval RTEMS_INVALID_ID Invalid scheduler identifier.
 * @retval RTEMS_NOT_CONFIGURED The processor is not configured to be used by
 *   the application.
 * @retval RTEMS_INCORRECT_STATE The processor is configured to be used by
 *   the application, however, it is not available.
 */
rtems_status_code rtems_scheduler_add_processor(
  rtems_id scheduler_id,
  uint32_t cpu_index
);

/**
 * @brief Removes a processor from set of processors owned by the scheduler.
 *
 * Must be called from task context.  This operation obtains and releases the
 * objects allocator lock.  Removing a processor from a scheduler is a complex
 * operation that involves all tasks in the system.
 *
 * @param[in] scheduler_id Identifier of the scheduler.
 * @param[in] cpu_index Index of the processor to add.
 *
 * @retval RTEMS_SUCCESSFUL Successful operation.
 * @retval RTEMS_INVALID_ID Invalid scheduler identifier.
 * @retval RTEMS_INVALID_NUMBER The processor is not owned by the scheduler.
 * @retval RTEMS_RESOURCE_IN_USE The set of processors owned by the scheduler
 *   would be empty after the processor removal and there exists a non-idle
 *   task that uses this scheduler as its home scheduler.
 */
rtems_status_code rtems_scheduler_remove_processor(
  rtems_id scheduler_id,
  uint32_t cpu_index
);

Change History (11)

comment:1 Changed on Nov 10, 2016 at 8:59:39 AM by Sebastian Huber <sebastian.huber@…>

In 2612a0bf5b9f0105315d62cbacfa9d29a5caa4b5/rtems:

score: Simplify _Scheduler_Get_by_id()

Avoid dead code in non-SMP configurations. Return scheduler identifier
independent of the current processor count of the scheduler via
rtems_scheduler_ident(), since this value may change during run-time.
Check the processor count in _Scheduler_Set() under scheduler lock
protection.

Update #2797.

comment:2 Changed on Nov 10, 2016 at 8:59:58 AM by Sebastian Huber <sebastian.huber@…>

In 1c46b80329d5d099022d8c7e0a8c593845120729/rtems:

score: Add scheduler to per-CPU information

This makes it possible to adjust the scheduler of a processor at
run-time.

Update #2797.

comment:3 Changed on Nov 10, 2016 at 9:00:18 AM by Sebastian Huber <sebastian.huber@…>

In e6107854b2511decef8c209cde14c4826a33ff01/rtems:

score: Rename _Scheduler_Assignments

Rename _Scheduler_Assignments into _Scheduler_Initial_assignments to
make it clear that they may not reflect the run-time scheduler
assignment.

Update #2797.

comment:4 Changed on Nov 10, 2016 at 9:00:27 AM by Sebastian Huber <sebastian.huber@…>

In 1f5bee3d85405d42a7f35caf3ff0c190789afd60/rtems:

score: Add and use Thread_Control::is_idle

Update #2797.

comment:5 Changed on Nov 10, 2016 at 9:00:37 AM by Sebastian Huber <sebastian.huber@…>

In 05ca53ddf6bc8333c2f3ad861c5415467c3262d2/rtems:

rtems: Add scheduler processor add/remove

Update #2797.

comment:6 Changed on Nov 10, 2016 at 10:35:44 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

comment:7 Changed on Dec 2, 2016 at 10:19:31 AM by Sebastian Huber <sebastian.huber@…>

In d10716f98f950348cf25df9097402987b6e219fc/rtems:

rtems: Fix rtems_scheduler_add_processor()

Fix thread dispatch profiling of rtems_scheduler_add_processor().

Update #2797.

comment:8 Changed on Dec 2, 2016 at 10:52:04 AM by Sebastian Huber <sebastian.huber@…>

In 7da78cf637e5d039fd1e0aafd99b282626f9e266/rtems:

rtems: Use _Thread_Dispatch_direct()

Update #2797.

comment:9 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber

Milestone: 4.124.12.0

comment:10 Changed on Oct 10, 2017 at 6:24:23 AM by Sebastian Huber

Component: SMPrtems

comment:11 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.