3 * (C) COPYRIGHT 2011-2015 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
21 * Completely Fair Job Scheduler Policy structure definitions
24 #ifndef _KBASE_JS_POLICY_CFS_H_
25 #define _KBASE_JS_POLICY_CFS_H_
27 #define KBASEP_JS_RUNTIME_EMPTY ((u64)-1)
30 * struct kbasep_js_policy_cfs - Data for the CFS policy
31 * @head_runtime_us: Number of microseconds the least-run context has been
32 * running for. The kbasep_js_device_data.queue_mutex must
33 * be held whilst updating this.
34 * Reads are possible without this mutex, but an older value
35 * might be read if no memory barries are issued beforehand.
36 * @least_runtime_us: Number of microseconds the least-run context in the
37 * context queue has been running for.
38 * -1 if context queue is empty.
39 * @rt_least_runtime_us: Number of microseconds the least-run context in the
40 * realtime (priority) context queue has been running for.
41 * -1 if realtime context queue is empty
43 struct kbasep_js_policy_cfs {
45 atomic64_t least_runtime_us;
46 atomic64_t rt_least_runtime_us;
50 * struct kbasep_js_policy_cfs_ctx - a single linked list of all contexts
51 * @runtime_us: microseconds this context has been running for
52 * @process_rt_policy: set if calling process policy scheme is a realtime
53 * scheduler and will use the priority queue. Non-mutable
55 * @process_priority: calling process NICE priority, in the range -20..19
57 * &kbasep_js_device_data.runpool_irq.lock must be held when updating
58 * @runtime_us. Initializing will occur on context init and context enqueue
59 * (which can only occur in one thread at a time), but multi-thread access only
60 * occurs while the context is in the runpool.
62 * Reads are possible without the spinlock, but an older value might be read if
63 * no memory barries are issued beforehand.
65 struct kbasep_js_policy_cfs_ctx {
67 bool process_rt_policy;
72 * struct kbasep_js_policy_cfs_job - per job information for CFS
73 * @ticks: number of ticks that this job has been executing for
75 * &kbasep_js_device_data.runpool_irq.lock must be held when accessing @ticks.
77 struct kbasep_js_policy_cfs_job {