From c5831a3f9af11228dbdaabaf01f69d37e55684ef Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 9 Apr 2014 15:07:54 +0200 Subject: score: Add clustered/partitioned scheduling Clustered/partitioned scheduling helps to control the worst-case latencies in the system. The goal is to reduce the amount of shared state in the system and thus prevention of lock contention. Modern multi-processor systems tend to have several layers of data and instruction caches. With clustered/partitioned scheduling it is possible to honour the cache topology of a system and thus avoid expensive cache synchronization traffic. We have clustered scheduling in case the set of processors of a system is partitioned into non-empty pairwise-disjoint subsets. These subsets are called clusters. Clusters with a cardinality of one are partitions. Each cluster is owned by exactly one scheduler instance. --- cpukit/posix/src/pthreadcreate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpukit/posix/src/pthreadcreate.c') diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index f85e1efcfd..c448c4253b 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -60,6 +60,7 @@ int pthread_create( bool is_fp; bool status; Thread_Control *the_thread; + Thread_Control *executing; POSIX_API_Control *api; int schedpolicy = SCHED_RR; struct sched_param schedparam; @@ -89,6 +90,8 @@ int pthread_create( rtems_set_errno_and_return_minus_one( ENOSYS ); #endif + executing = _Thread_Get_executing(); + /* * P1003.1c/Draft 10, p. 121. * @@ -99,7 +102,7 @@ int pthread_create( */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: - api = _Thread_Get_executing()->API_Extensions[ THREAD_API_POSIX ]; + api = executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; @@ -176,6 +179,7 @@ int pthread_create( status = _Thread_Initialize( &_POSIX_Threads_Information, the_thread, + _Scheduler_Get( executing ), the_attr->stackaddr, _POSIX_Threads_Ensure_minimum_stack(the_attr->stacksize), is_fp, @@ -194,7 +198,6 @@ int pthread_create( #if defined(RTEMS_SMP) && __RTEMS_HAVE_SYS_CPUSET_H__ status = _Scheduler_Set_affinity( - _Scheduler_Get( the_thread ), the_thread, the_attr->affinitysetsize, the_attr->affinityset -- cgit v1.2.3