diff options
author | Sidath Senanayake <sidaths@google.com> | 2021-03-03 17:42:16 +0000 |
---|---|---|
committer | Sidath Senanayake <sidaths@google.com> | 2021-03-04 01:20:03 +0000 |
commit | 3b197c6d53bf0cf57ba54d9864acb9145e987382 (patch) | |
tree | 566c387fd4a5d3caca0d308388c786ad6b20902b /mali_kbase/mali_kbase.h | |
parent | 8ba85e20fe56a382b4ad631c44b362d29dc4a6d1 (diff) | |
download | gpu-3b197c6d53bf0cf57ba54d9864acb9145e987382.tar.gz |
mali_kbase: Move all RT threads onto a coremask
Updates all lightweight realtime worker threads in kbase to use
a coremask that limits them to the little cluster. Created a
single function that performs this set up and moved all rt thread
creation instances to use it.
Bug: 181777616
Bug: 181582516
Signed-off-by: Sidath Senanayake <sidaths@google.com>
Change-Id: Ib499541aa7a5777f3b9327637f862c6c67fa2fa0
Diffstat (limited to 'mali_kbase/mali_kbase.h')
-rw-r--r-- | mali_kbase/mali_kbase.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mali_kbase/mali_kbase.h b/mali_kbase/mali_kbase.h index d2346e1..dabd9b8 100644 --- a/mali_kbase/mali_kbase.h +++ b/mali_kbase/mali_kbase.h @@ -66,6 +66,9 @@ #include <linux/kthread.h> #include <linux/interrupt.h> +#include <linux/sched/rt.h> +#include <uapi/linux/sched/types.h> + #include "mali_base_kernel.h" #include <mali_kbase_linux.h> @@ -629,6 +632,22 @@ void kbase_disjoint_state_down(struct kbase_device *kbdev); */ #define KBASE_DISJOINT_STATE_INTERLEAVED_CONTEXT_COUNT_THRESHOLD 2 +/** + * kbase_create_realtime_thread - Create a realtime thread with an appropriate coremask + * + * @kbdev: the kbase device + * @threadfn: the function the realtime thread will execute + * @data: pointer to the thread's data + * @namefmt: a name for the thread. + * + * Creates a realtime kthread with priority &KBASE_RT_THREAD_PRIO and restricted + * to cores defined by &KBASE_RT_THREAD_CPUMASK_MIN and &KBASE_RT_THREAD_CPUMASK_MAX. + * + * Return: A valid &struct task_struct pointer on success, or an ERR_PTR on failure. + */ +struct task_struct * kbase_create_realtime_thread(struct kbase_device *kbdev, + int (*threadfn)(void *data), void *data, const char namefmt[]); + #if !defined(UINT64_MAX) #define UINT64_MAX ((uint64_t)0xFFFFFFFFFFFFFFFFULL) #endif |