Re: mi_switch() & setting `p_stat'

2021-10-03 Thread Martin Pieuchot
On 02/10/21(Sat) 21:09, Mark Kettenis wrote: > > Date: Sat, 2 Oct 2021 20:35:41 +0200 > > From: Martin Pieuchot > > [...] > > There's no sleeping point but a call to wakeup(). This wakeup() is > > supposed to wake a btrace(8) process. But if the curproc, which just > > added itself to the

Re: mi_switch() & setting `p_stat'

2021-10-02 Thread Philip Guenther
On Sat, Oct 2, 2021 at 8:57 AM Martin Pieuchot wrote: > When a thread running on a CPU schedules itself out, it does the following > (pseudo_code): > > SCHED_LOCK() > curproc->p_stat = SSLEEP; > // some more operations > mi_switch() > > The problem with this is

Re: mi_switch() & setting `p_stat'

2021-10-02 Thread Mark Kettenis
> Date: Sat, 2 Oct 2021 20:35:41 +0200 > From: Martin Pieuchot > > On 02/10/21(Sat) 20:24, Mark Kettenis wrote: > > > Date: Sat, 2 Oct 2021 19:55:49 +0200 > > > From: Martin Pieuchot > > > > > > When a thread running on a CPU schedules itself out, it does the following > > > (pseudo_code): > >

Re: mi_switch() & setting `p_stat'

2021-10-02 Thread Martin Pieuchot
On 02/10/21(Sat) 20:24, Mark Kettenis wrote: > > Date: Sat, 2 Oct 2021 19:55:49 +0200 > > From: Martin Pieuchot > > > > When a thread running on a CPU schedules itself out, it does the following > > (pseudo_code): > > > > SCHED_LOCK() > > curproc->p_stat = SSLEEP; > > // some more

Re: mi_switch() & setting `p_stat'

2021-10-02 Thread Mark Kettenis
> Date: Sat, 2 Oct 2021 19:55:49 +0200 > From: Martin Pieuchot > > When a thread running on a CPU schedules itself out, it does the following > (pseudo_code): > > SCHED_LOCK() > curproc->p_stat = SSLEEP; > // some more operations > mi_switch() > > The problem with this

mi_switch() & setting `p_stat'

2021-10-02 Thread Martin Pieuchot
When a thread running on a CPU schedules itself out, it does the following (pseudo_code): SCHED_LOCK() curproc->p_stat = SSLEEP; // some more operations mi_switch() The problem with this is that any instrumentation between setting `p_stat' and cpu_switchto() is