File tree Expand file tree Collapse file tree 5 files changed +71
-0
lines changed
Documentation/admin-guide Expand file tree Collapse file tree 5 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 6387
6387
sa1100ir [NET]
6388
6388
See drivers/net/irda/sa1100_ir.c.
6389
6389
6390
+ sched_proxy_exec= [KNL]
6391
+ Enables or disables "proxy execution" style
6392
+ solution to mutex-based priority inversion.
6393
+ Format: <bool>
6394
+
6390
6395
sched_verbose [KNL,EARLY] Enables verbose scheduler debug messages.
6391
6396
6392
6397
schedstats= [KNL,X86] Enable or disable scheduled statistics.
Original file line number Diff line number Diff line change @@ -1656,6 +1656,19 @@ struct task_struct {
1656
1656
randomized_struct_fields_end
1657
1657
} __attribute__ ((aligned (64 )));
1658
1658
1659
+ #ifdef CONFIG_SCHED_PROXY_EXEC
1660
+ DECLARE_STATIC_KEY_TRUE (__sched_proxy_exec );
1661
+ static inline bool sched_proxy_exec (void )
1662
+ {
1663
+ return static_branch_likely (& __sched_proxy_exec );
1664
+ }
1665
+ #else
1666
+ static inline bool sched_proxy_exec (void )
1667
+ {
1668
+ return false;
1669
+ }
1670
+ #endif
1671
+
1659
1672
#define TASK_REPORT_IDLE (TASK_REPORT + 1)
1660
1673
#define TASK_REPORT_MAX (TASK_REPORT_IDLE << 1)
1661
1674
Original file line number Diff line number Diff line change @@ -878,6 +878,18 @@ config UCLAMP_BUCKETS_COUNT
878
878
879
879
If in doubt, use the default value.
880
880
881
+ config SCHED_PROXY_EXEC
882
+ bool "Proxy Execution"
883
+ # Avoid some build failures w/ PREEMPT_RT until it can be fixed
884
+ depends on !PREEMPT_RT
885
+ # Need to investigate how to inform sched_ext of split contexts
886
+ depends on !SCHED_CLASS_EXT
887
+ # Not particularly useful until we get to multi-rq proxying
888
+ depends on EXPERT
889
+ help
890
+ This option enables proxy execution, a mechanism for mutex-owning
891
+ tasks to inherit the scheduling context of higher priority waiters.
892
+
881
893
endmenu
882
894
883
895
#
Original file line number Diff line number Diff line change @@ -119,6 +119,35 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp);
119
119
120
120
DEFINE_PER_CPU_SHARED_ALIGNED (struct rq , runqueues );
121
121
122
+ #ifdef CONFIG_SCHED_PROXY_EXEC
123
+ DEFINE_STATIC_KEY_TRUE (__sched_proxy_exec );
124
+ static int __init setup_proxy_exec (char * str )
125
+ {
126
+ bool proxy_enable = true;
127
+
128
+ if (* str && kstrtobool (str + 1 , & proxy_enable )) {
129
+ pr_warn ("Unable to parse sched_proxy_exec=\n" );
130
+ return 0 ;
131
+ }
132
+
133
+ if (proxy_enable ) {
134
+ pr_info ("sched_proxy_exec enabled via boot arg\n" );
135
+ static_branch_enable (& __sched_proxy_exec );
136
+ } else {
137
+ pr_info ("sched_proxy_exec disabled via boot arg\n" );
138
+ static_branch_disable (& __sched_proxy_exec );
139
+ }
140
+ return 1 ;
141
+ }
142
+ #else
143
+ static int __init setup_proxy_exec (char * str )
144
+ {
145
+ pr_warn ("CONFIG_SCHED_PROXY_EXEC=n, so it cannot be enabled or disabled at boot time\n" );
146
+ return 0 ;
147
+ }
148
+ #endif
149
+ __setup ("sched_proxy_exec" , setup_proxy_exec );
150
+
122
151
/*
123
152
* Debugging: various feature bits
124
153
*
Original file line number Diff line number Diff line change @@ -1142,10 +1142,15 @@ struct rq {
1142
1142
*/
1143
1143
unsigned long nr_uninterruptible ;
1144
1144
1145
+ #ifdef CONFIG_SCHED_PROXY_EXEC
1146
+ struct task_struct __rcu * donor ; /* Scheduling context */
1147
+ struct task_struct __rcu * curr ; /* Execution context */
1148
+ #else
1145
1149
union {
1146
1150
struct task_struct __rcu * donor ; /* Scheduler context */
1147
1151
struct task_struct __rcu * curr ; /* Execution context */
1148
1152
};
1153
+ #endif
1149
1154
struct sched_dl_entity * dl_server ;
1150
1155
struct task_struct * idle ;
1151
1156
struct task_struct * stop ;
@@ -1326,10 +1331,17 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
1326
1331
#define cpu_curr (cpu ) (cpu_rq(cpu)->curr)
1327
1332
#define raw_rq () raw_cpu_ptr(&runqueues)
1328
1333
1334
+ #ifdef CONFIG_SCHED_PROXY_EXEC
1335
+ static inline void rq_set_donor (struct rq * rq , struct task_struct * t )
1336
+ {
1337
+ rcu_assign_pointer (rq -> donor , t );
1338
+ }
1339
+ #else
1329
1340
static inline void rq_set_donor (struct rq * rq , struct task_struct * t )
1330
1341
{
1331
1342
/* Do nothing */
1332
1343
}
1344
+ #endif
1333
1345
1334
1346
#ifdef CONFIG_SCHED_CORE
1335
1347
static inline struct cpumask * sched_group_span (struct sched_group * sg );
You can’t perform that action at this time.
0 commit comments