[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Minios-devel] [UNIKRAFT PATCH 16/23] lib/ukschedpreempt: Use hardware context for thread switching
- To: minios-devel@xxxxxxxxxxxxx
- From: Costin Lupu <costin.lupu@xxxxxxxxx>
- Date: Mon, 8 Jul 2019 11:33:45 +0300
- Cc: felipe.huici@xxxxxxxxx, simon.kuenzer@xxxxxxxxx
- Delivery-date: Mon, 08 Jul 2019 08:50:16 +0000
- Ironport-phdr: 9a23:EptRYhXif1uvFCD5E4x4uHRL2/3V8LGtZVwlr6E/grcLSJyIuqrYbBOCt8tkgFKBZ4jH8fUM07OQ7/m6HzBYqs7d+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAiooQnLucQanYRuJro+xxDUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0jioMKjg0+3zVhMNtlqJWuBKvqQJizYDaY4+bM/hxfq3GcN8GWWZMRNpdWjZdDo+gaYYEEuoPPfxfr4n4v1YDsxy+BRKwBOPuzD9Dm3n43bAi0+Q8DArL2xAvH9UVsHTIrdX1Mr0eUeSozKnQ0DXOdO9Z2Szn5IjQbxAuuuuAXah3ccfIz0QkCgDLjk2IpID4MD6Zy/4Bvmub4uZ6S+6jlWwqpxt/rzS328shhZTFipgWx13E7yl13og4KNOiREJmbtOoDp1dvDyAOYRsWMMtWWRotT4/yr0BpJG0YjAHyI8ixx7Dc/yHdJWI4g77WOaRPzh4gHVldaqhhxa360egy+n8WtOo31ZRtCZFisTMuWsX2xzJ7ciLUvp9/kG/1jaTzw3f9+5JLV0umafYK5Mt2KA8moQRvEjZECL6gED2g7WXdkUg9Oio8ePnYrD+q5CAMI90kR3+MqUomsClBeQ4LxAOX3WA9Ougz73v51X5QKhRgfEsiKnZt4jWJd4Hqa6hHw9VzoEj5g66Dzen1tQYnH4HLElcdB2akYfpJU/BIPTjAPe7glSsiytrx+vcMrzuHJrNKGLPkLD7fbZy80Rc0hY8zchD55JIDbEMOPzzVVH1tNzZFh82LRa4w+b6CNV8yoweWHmCAqmHP6zOtV+H/PkgL/OSa48IoDz9MeQq5+byjX8lnl8QZbKp3ZoSaHC/GPRqOUaZYWfyjdcHEGYFoBA+QffsiFKcTTFTY2y9ULkm6j4lFYL1RbvEE4Wshr2Gx2K3E4NbYkhCC0uQCjH4eoPCXO0DOwyIJco0uTsfSbmnA6s8zQzm4AT90KZmKKzQ5zUFnZn4ksBo7avJkkdhpnRPE82B3jTVHClPlWQSSmpu0Q==
- Ironport-sdr: SBNurY1o6/FQMwtCQwUIlRBdpNNWOV2anPaJilIRUPV0DLrXWyawQXQnsIJ7kxToPLJ1fppOUg FDHeuSM53mAA==
- List-id: Mini-os development list <minios-devel.lists.xenproject.org>
Unlike cooperative scheduling where a thread gets scheduled only if the
previous thread yielded the CPU, in the case of preemptive scheduling we need
hardware support in order to preempt threads and switch to ready threads. That
is because threads may get preempted on timer interrupts if their time slice
expires.
Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
lib/ukschedpreempt/schedpreempt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/ukschedpreempt/schedpreempt.c
b/lib/ukschedpreempt/schedpreempt.c
index 789c34db..faaefd2e 100644
--- a/lib/ukschedpreempt/schedpreempt.c
+++ b/lib/ukschedpreempt/schedpreempt.c
@@ -48,6 +48,8 @@ struct uk_sched *uk_schedpreempt_init(struct uk_alloc *a)
if (sched == NULL)
goto out_err;
+ ukplat_ctx_callbacks_init(&sched->plat_ctx_cbs, ukplat_ctx_hw);
+
prv = sched->prv;
uk_sched_init(sched,
--
2.20.1
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|