Commit 0366017
committed
sched_ext: Use task_can_run_on_remote_rq() test in dispatch_to_local_dsq()
When deciding whether a task can be migrated to a CPU,
dispatch_to_local_dsq() was open-coding p->cpus_allowed and scx_rq_online()
tests instead of using task_can_run_on_remote_rq(). This had two problems.
- It was missing is_migration_disabled() check and thus could try to migrate
a task which shouldn't leading to assertion and scheduling failures.
- It was testing p->cpus_ptr directly instead of using task_allowed_on_cpu()
and thus failed to consider ISA compatibility.
Update dispatch_to_local_dsq() to use task_can_run_on_remote_rq():
- Move scx_ops_error() triggering into task_can_run_on_remote_rq().
- When migration isn't allowed, fall back to the global DSQ instead of the
source DSQ by returning DTL_INVALID. This is both simpler and an overall
better behavior.
Signed-off-by: Tejun Heo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Acked-by: David Vernet <[email protected]>1 parent bf934be commit 0366017
1 file changed
+20
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2203 | 2203 | | |
2204 | 2204 | | |
2205 | 2205 | | |
2206 | | - | |
| 2206 | + | |
| 2207 | + | |
2207 | 2208 | | |
2208 | 2209 | | |
2209 | 2210 | | |
2210 | | - | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
2211 | 2221 | | |
| 2222 | + | |
| 2223 | + | |
2212 | 2224 | | |
2213 | 2225 | | |
| 2226 | + | |
2214 | 2227 | | |
2215 | 2228 | | |
| 2229 | + | |
2216 | 2230 | | |
2217 | 2231 | | |
2218 | 2232 | | |
| |||
2240 | 2254 | | |
2241 | 2255 | | |
2242 | 2256 | | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
| 2257 | + | |
| 2258 | + | |
2246 | 2259 | | |
2247 | 2260 | | |
2248 | 2261 | | |
| |||
2267 | 2280 | | |
2268 | 2281 | | |
2269 | 2282 | | |
2270 | | - | |
| 2283 | + | |
2271 | 2284 | | |
2272 | 2285 | | |
2273 | 2286 | | |
| |||
2330 | 2343 | | |
2331 | 2344 | | |
2332 | 2345 | | |
2333 | | - | |
| 2346 | + | |
2334 | 2347 | | |
2335 | 2348 | | |
2336 | 2349 | | |
| |||
2355 | 2368 | | |
2356 | 2369 | | |
2357 | 2370 | | |
2358 | | - | |
2359 | | - | |
2360 | | - | |
2361 | | - | |
2362 | | - | |
2363 | | - | |
2364 | | - | |
2365 | | - | |
2366 | | - | |
2367 | | - | |
2368 | | - | |
2369 | 2371 | | |
2370 | 2372 | | |
2371 | 2373 | | |
| |||
2399 | 2401 | | |
2400 | 2402 | | |
2401 | 2403 | | |
2402 | | - | |
2403 | | - | |
2404 | 2404 | | |
2405 | 2405 | | |
2406 | 2406 | | |
| |||
0 commit comments