Changeset 154fb0f9 in rtems-docs


Ignore:
Timestamp:
Mar 8, 2018, 7:04:25 AM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
36d7463
Parents:
0472ead
git-author:
Sebastian Huber <sebastian.huber@…> (03/08/18 07:04:25)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/12/18 06:14:36)
Message:

c-user: Simplify clustered scheduler configuration

Close #3325.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c-user/configuring_a_system.rst

    r0472ead r154fb0f9  
    36153615    following additional macros must be defined:
    36163616
    3617     - ``CONFIGURE_SCHEDULER_CONTEXT`` must be defined to a static definition of
    3618       the scheduler context of the user scheduler.
    3619 
    3620     - ``CONFIGURE_SCHEDULER_CONTROLS`` must be defined to a scheduler control
    3621       initializer for the user scheduler.
     3617    - ``CONFIGURE_SCHEDULER`` must be defined to a static definition of
     3618      the scheduler data structures of the user scheduler.
     3619
     3620    - ``CONFIGURE_SCHEDULER_TABLE_ENTRIES`` must be defined to a scheduler
     3621      table entry initializer for the user scheduler.
    36223622
    36233623    - ``CONFIGURE_SCHEDULER_USER_PER_THREAD`` must be defined to the type of
     
    36383638
    36393639Clustered scheduling helps to control the worst-case latencies in a
    3640 multi-processor system (SMP).  The goal is to reduce the amount of shared state
    3641 in the system and thus prevention of lock contention.  Modern multi-processor
     3640multiprocessor system (SMP).  The goal is to reduce the amount of shared state
     3641in the system and thus prevention of lock contention.  Modern multiprocessor
    36423642systems tend to have several layers of data and instruction caches.  With
    36433643clustered scheduling it is possible to honour the cache topology of a system
     
    36473647partitioned into non-empty pairwise-disjoint subsets.  These subsets are called
    36483648clusters.  Clusters with a cardinality of one are partitions.  Each cluster is
    3649 owned by exactly one scheduler instance.
     3649owned by exactly one scheduler.
    36503650
    36513651A clustered scheduler configuration is optional.  By default, up to 32
     
    36753675
    36763676This is necessary to calculate the per-thread overhead introduced by the
    3677 schedulers.  After these definitions the configuration file must ``#include
    3678 <rtems/scheduler.h>`` to have access to scheduler-specific configuration
    3679 macros.
     3677scheduler algorithms.  After these definitions the configuration file must
     3678``#include <rtems/scheduler.h>`` to have access to scheduler-specific
     3679configuration macros.
     3680
     3681It is possible to make more than one scheduler algorithm available to the
     3682application.  For example a :ref:`Simple Priority SMP Scheduler
     3683<SchedulerSMPPrioritySimple>` could be used in a partition for low latency
     3684tasks in addition to the :ref:`EDF SMP Scheduler <SchedulerSMPEDF>` for a
     3685general-purpose cluster.  Since the per-thread overhead depends on the
     3686scheduler algorithm only the scheduler algorithms used by the application
     3687should be configured.
    36803688
    36813689Configuration Step 2 - Schedulers
    36823690---------------------------------
    36833691
    3684 Each scheduler needs a context to store state information at run-time.  Use the
    3685 following macros to create scheduler contexts
    3686 
    3687 - ``RTEMS_SCHEDULER_CONTEXT_EDF_SMP(name, max_cpu_count)``,
    3688 
    3689 - ``RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP(name, prio_count)``,
    3690 
    3691 - ``RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(name, prio_count)``, and
    3692 
    3693 - ``RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(name)``.
    3694 
    3695 The ``name`` parameter is used as part of a designator for a global variable,
    3696 so the usual C/C++ designator rules apply.  This ``name`` is not the scheduler
    3697 object name.  Additional parameters are scheduler-specific.
     3692Each scheduler needs some data structures.  Use the following macros to create
     3693the scheduler data structures for a particular scheduler identified in the
     3694configuration by ``name``.
     3695
     3696- ``RTEMS_SCHEDULER_EDF_SMP(name, max_cpu_count)``,
     3697
     3698- ``RTEMS_SCHEDULER_PRIORITY_AFFINITY_SMP(name, prio_count)``,
     3699
     3700- ``RTEMS_SCHEDULER_PRIORITY_SMP(name, prio_count)``, and
     3701
     3702- ``RTEMS_SCHEDULER_SIMPLE_SMP(name)``.
     3703
     3704The ``name`` parameter is used as part of a designator for scheduler-specific
     3705data structures, so the usual C/C++ designator rules apply.  This ``name`` is
     3706not the scheduler object name.  Additional parameters are scheduler-specific.
    36983707
    36993708.. _ConfigurationSchedulerTable:
     
    37023711--------------------------------------
    37033712
    3704 The schedulers are registered in the system via the scheduler table.
    3705 To create the scheduler table define ``CONFIGURE_SCHEDULER_CONTROLS`` to a list
    3706 of the following scheduler control initializers
    3707 
    3708 - ``RTEMS_SCHEDULER_CONTROL_EDF_SMP(name, obj_name)``,
    3709 
    3710 - ``RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP(name, obj_name)``,
    3711 
    3712 - ``RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(name, obj_name)``, and
    3713 
    3714 - ``RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(name, obj_name)``.
     3713The schedulers are registered in the system via the scheduler table.  To
     3714populate the scheduler table define ``CONFIGURE_SCHEDULER_TABLE_ENTRIES`` to a
     3715list of the following scheduler table entry initializers
     3716
     3717- ``RTEMS_SCHEDULER_TABLE_EDF_SMP(name, obj_name)``,
     3718
     3719- ``RTEMS_SCHEDULER_TABLE_PRIORITY_AFFINITY_SMP(name, obj_name)``,
     3720
     3721- ``RTEMS_SCHEDULER_TABLE_PRIORITY_SMP(name, obj_name)``, and
     3722
     3723- ``RTEMS_SCHEDULER_TABLE_SIMPLE_SMP(name, obj_name)``.
    37153724
    37163725The ``name`` parameter must correspond to the parameter defining the scheduler
    3717 context.  The ``obj_name`` determines the scheduler object name and can be used
    3718 in :ref:`rtems_scheduler_ident() <rtems_scheduler_ident>` to get the scheduler
    3719 object identifier.  The scheduler index is defined by the index of the
    3720 scheduler table.  It is a configuration error to add a scheduler multiple times
    3721 to the scheduler table.
     3726data structures of configuration step 2.  The ``obj_name`` determines the
     3727scheduler object name and can be used in :ref:`rtems_scheduler_ident()
     3728<rtems_scheduler_ident>` to get the scheduler object identifier.  The scheduler
     3729index is defined by the index of the scheduler table.  It is a configuration
     3730error to add a scheduler multiple times to the scheduler table.
    37223731
    37233732Configuration Step 4 - Processor to Scheduler Assignment
     
    37323741mandatory processors than available then a fatal run-time error will occur.  To
    37333742specify the scheduler assignments define
    3734 ``CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS`` to a list of
     3743``CONFIGURE_SCHEDULER_ASSIGNMENTS`` to a list of
    37353744
    37363745- ``RTEMS_SCHEDULER_ASSIGN(scheduler_index, attr)`` and
     
    37383747- ``RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER``
    37393748
    3740 macros.  The ``scheduler_index`` parameter must
    3741 be a valid index into the scheduler table.  The ``attr`` parameter defines the
    3742 scheduler assignment attributes.  By default, a scheduler assignment to a
    3743 processor is optional.  For the scheduler assignment attribute use one of the
    3744 mutually exclusive variants
     3749macros.  The ``scheduler_index`` parameter must be a valid index into the
     3750scheduler table defined by configuration step 3.  The ``attr`` parameter
     3751defines the scheduler assignment attributes.  By default, a scheduler
     3752assignment to a processor is optional.  For the scheduler assignment attribute
     3753use one of the mutually exclusive variants
    37453754
    37463755- ``RTEMS_SCHEDULER_ASSIGN_DEFAULT``,
     
    37873796
    37883797    /* Configuration Step 2 - Schedulers */
    3789     RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(io, CONFIGURE_MAXIMUM_PRIORITY + 1);
    3790     RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(work, CONFIGURE_MAXIMUM_PRIORITY + 1);
     3798    RTEMS_SCHEDULER_PRIORITY_SMP(io, CONFIGURE_MAXIMUM_PRIORITY + 1);
     3799    RTEMS_SCHEDULER_PRIORITY_SMP(work, CONFIGURE_MAXIMUM_PRIORITY + 1);
    37913800
    37923801    /* Configuration Step 3 - Scheduler Table */
    3793     #define CONFIGURE_SCHEDULER_CONTROLS \\
    3794       RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \
     3802    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \\
     3803      RTEMS_SCHEDULER_TABLE_PRIORITY_SMP( \
    37953804        io, \
    37963805         rtems_build_name('I', 'O', ' ', ' ') \
    37973806      ), \
    3798       RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \
     3807      RTEMS_SCHEDULER_TABLE_PRIORITY_SMP( \
    37993808        work, \
    38003809        rtems_build_name('W', 'O', 'R', 'K') \
     
    38023811
    38033812    /* Configuration Step 4 - Processor to Scheduler Assignment */
    3804     #define CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS \
     3813    #define CONFIGURE_SCHEDULER_ASSIGNMENTS \
    38053814      RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
    38063815      RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER, \
     
    38153824--------------------
    38163825
    3817 In case one of the scheduler indices in ``CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS``
     3826In case one of the scheduler indices in ``CONFIGURE_SCHEDULER_ASSIGNMENTS``
    38183827is invalid a link-time error will occur with an undefined reference to
    38193828``RTEMS_SCHEDULER_INVALID_INDEX``.
     
    38333842  processor failed during system initialization.  The system may not have this
    38343843  processor at all or it could be a problem with a boot loader for example.
    3835   Check the ``CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS`` definition.
     3844  Check the ``CONFIGURE_SCHEDULER_ASSIGNMENTS`` definition.
    38363845
    38373846- ``SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR`` - it is not allowed
Note: See TracChangeset for help on using the changeset viewer.