Changes between Version 49 and Version 50 of Developer/SMP


Ignore:
Timestamp:
03/05/14 22:28:42 (10 years ago)
Author:
JoelSherrill
Comment:

/* Future Directions */ Update

Legend:

Unmodified
Added
Removed
Modified
  • Developer/SMP

    v49 v50  
    102102
    103103The APIs for <sys/cpuset.h>, pthread affinity, and Classic API task affinity have been community reviewed and patches have been posted. The current work is "data complete" in that one can get and set using the APIs but no scheduler currently supports affinity.
    104 ==  Future Directions  ==
    105 
    106 
    107 Implement the missing feature.  This consists of two parts
    108 
    109  *  the application level API, and
    110  *  the scheduler support.
    111 
    112 There is no POSIX API available that covers thread processor affinity.  Linux
    113 is the de facto standard system for high performance computing so it is
    114 obvious to choose a Linux compatible API for RTEMS.  Linux provides
    115 [http://man7.org/linux/man-pages/man3/CPU_SET.3.html CPU_SET(3)] to manage sets
    116 of processors.  Thread processor affinity can be controlled via
     104==  Background  ==
     105
     106
     107There are multiple pieces of work involved in supporting thread processor affinity
     108
     109 *  the POSIX application level API,
     110 *  the Classic application level API,
     111 *  scheduler framework modifications, and
     112 *  actual scheduler support.
     113
     114There is no POSIX API available that covers thread processor affinity.  Linux is the de facto standard system for high performance computing so it is obvious to choose a Linux compatible API for RTEMS.  Linux provides
     115[http://man7.org/linux/man-pages/man3/CPU_SET.3.html CPU_SET(3)] to manage sets of processors.  Thread processor affinity can be controlled via
    117116[http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html SCHED_SETAFFINITY(2)]
    118117and
    119118[http://man7.org/linux/man-pages/man3/pthread_setaffinity_np.3.html PTHREAD_SETAFFINITY_NP(3)].
    120 RTEMS should provide these APIs and implement them.  It is not possible to use
    121 the Linux files directly since they have a pure GPL license.
     119
     120 *  Once the work is complete, RTEMS will provide these APIs.  The implementation shares no code with GNU/Linux since it is not possible to use the Linux files directly since they have a pure GPL license.
     121
     122Work remains to be done on adding affinity to a new SMP Scheduler variant. The current plan calls for having the schedulers without affinity ignore input on a set affinity operation and return a cpu set with all CPUs set on all get affinity operations. A new SMP scheduler variant will be added to support affinity. Initially, this scheduler will only be sufficient to properly manage the thread's CPU set as a data element. Then an assignment algorithm will be added.
     123=  Theory  =
     124
    122125
    123126The scheduler support for arbitrary processor affinities is a major challenge.
     
    14991502
    15001503
    1501 One approach to do post-switch actions could be to spin on the per-processor
    1502 variable reflecting the executing thread.  This has at least two problems
    1503 # it doesn't work if the executing thread wants to alter its own state, and
    1504 # this spinning must be done with the scheduler lock held and interrupts disabled, this is a disaster for the interrupt latency,
    1505 
    1506 The proposed solution is to use an optional action handler which is active in
    1507 case the thread execution termination matters.  In _Thread_Dispatch() we have
    1508 already the post-switch extensions invoked after a thread switch.
    1509 Unfortunately they execute after thread dispatching is enabled again and at
    1510 this point the current processor may have already changed
     1504One approach to do post-switch actions could be to spin o