All of lore.kernel.org
 help / color / mirror / Atom feed
* [svsm-devel] [RFC] task/schedule: Idle process?
@ 2023-09-06 14:29 Carlos Bilbao
  2023-09-07  8:47 ` Jörg Rödel
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Bilbao @ 2023-09-06 14:29 UTC (permalink / raw)
  To: svsm-devel, Roy Hopkins

Hello,

The PR for the scheduler (#64) is still under review. In traditional OSs,
it makes sense to include an idle userspace process that does nothing and
is always there to be scheduled. So I was wondering if we should do the
same for the SVSM.

Currently, SVSM schedules the "root" task responsible for running the
request loop. However, in the event of a SvsmReqError:FatalError, this
process may terminate prematurely. This raises the question: should we
introduce an idle process in SVSM, or is it irrelevant in that context?

My first intuition is that if we don't have an idle process, then the SVSM
itself would terminate, and perhaps that would difficult further debugging
of potential errors. Or maybe it would not?

Thanks,
Carlos

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [svsm-devel] [RFC] task/schedule: Idle process?
  2023-09-06 14:29 [svsm-devel] [RFC] task/schedule: Idle process? Carlos Bilbao
@ 2023-09-07  8:47 ` Jörg Rödel
  2023-09-07 13:35   ` Roy Hopkins
  0 siblings, 1 reply; 3+ messages in thread
From: Jörg Rödel @ 2023-09-07  8:47 UTC (permalink / raw)
  To: Carlos Bilbao; +Cc: svsm-devel, Roy Hopkins

Hi Carlos,

On Wed, Sep 06, 2023 at 09:29:00AM -0500, Carlos Bilbao wrote:
> The PR for the scheduler (#64) is still under review. In traditional OSs,
> it makes sense to include an idle userspace process that does nothing and
> is always there to be scheduled. So I was wondering if we should do the
> same for the SVSM.
> 
> Currently, SVSM schedules the "root" task responsible for running the
> request loop. However, in the event of a SvsmReqError:FatalError, this
> process may terminate prematurely. This raises the question: should we
> introduce an idle process in SVSM, or is it irrelevant in that context?
> 
> My first intuition is that if we don't have an idle process, then the SVSM
> itself would terminate, and perhaps that would difficult further debugging
> of potential errors. Or maybe it would not?

Yes, we plan with an idle process. It will be the (kernel-only) process
that gives control back to the guest OS by switching the VMPL.

The idea is that we have a runqueue and execute tasks from that as
long as any of them is runable. Once no process is runable anymore the
idle task is selected by the scheduler and switches back to the guest
VMPL.

Regards,

	Joerg

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [svsm-devel] [RFC] task/schedule: Idle process?
  2023-09-07  8:47 ` Jörg Rödel
@ 2023-09-07 13:35   ` Roy Hopkins
  0 siblings, 0 replies; 3+ messages in thread
From: Roy Hopkins @ 2023-09-07 13:35 UTC (permalink / raw)
  To: carlos.bilbao@amd.com, joro@8bytes.org; +Cc: svsm-devel@coconut-svsm.dev

On Thu, 2023-09-07 at 10:47 +0200, Jörg Rödel wrote:
> Hi Carlos,
> 
> On Wed, Sep 06, 2023 at 09:29:00AM -0500, Carlos Bilbao wrote:
> > The PR for the scheduler (#64) is still under review. In traditional OSs,
> > it makes sense to include an idle userspace process that does nothing and
> > is always there to be scheduled. So I was wondering if we should do the
> > same for the SVSM.
> > 
> > Currently, SVSM schedules the "root" task responsible for running the
> > request loop. However, in the event of a SvsmReqError:FatalError, this
> > process may terminate prematurely. This raises the question: should we
> > introduce an idle process in SVSM, or is it irrelevant in that context?
> > 
> > My first intuition is that if we don't have an idle process, then the SVSM
> > itself would terminate, and perhaps that would difficult further debugging
> > of potential errors. Or maybe it would not?
> 
> Yes, we plan with an idle process. It will be the (kernel-only) process
> that gives control back to the guest OS by switching the VMPL.
> 
> The idea is that we have a runqueue and execute tasks from that as
> long as any of them is runable. Once no process is runable anymore the
> idle task is selected by the scheduler and switches back to the guest
> VMPL.
> 
> Regards,
> 
>         Joerg

I thought about incorporating an idle task into the current PR but until the
usage of tasks is a bit more mature and we start to support modules that
actually use tasks, it probably does not make sense to add an idle task yet.

I guess we could refactor the existing request_loop() function into its own task
and call this the 'idle task', allowing the entry point thread to return and
subsequently terminate and switch context. However, the request_loop() never
calls schedule() meaning the idle task will never cede execution. This is the
same behaviour as the current state of the PR but it is perhaps less obvious if
we call it an idle task.

Regards,
Roy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-07 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-06 14:29 [svsm-devel] [RFC] task/schedule: Idle process? Carlos Bilbao
2023-09-07  8:47 ` Jörg Rödel
2023-09-07 13:35   ` Roy Hopkins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.