9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] modification to sleep in changeset 285df38d5ed3
Date: Mon, 21 Dec 2020 14:08:38 +0100	[thread overview]
Message-ID: <7C972FA346E83CE34B2349FC63E619E9@felloff.net> (raw)
In-Reply-To: <X+AlUdO6wFrgcC/c@alice>

> Is it safe to call procsave after unlocking
> the process and the rendezvous in sleep?

yeah, i dont see any problem. the only thing that
holding Proc.rlock prevents is that someone doing
a wakeup() of the process, which basically does
a ready() on it, putting it back on the run queue.

procsave() itself doesnt change the process
state and doesnt block/sleep itself.

having the process on the run queue while it
executes procsave() shouldnt be an issue.
the scheduler cannot dequeue it until the
process has set up->mp = nil, which happens
after procsave() in schedinit() when the
scheduler stacks have been switched.

also note that procsave is also executed without
any locks when we call sched(). which is called
for example when a qlock() goes to sleep.

theres nothing there preventing the process
that is commited to sleep to be immediately
re-awakend by someone else as soon as qlock
releases the Qlock.use spinlock.

--
cinap

      reply	other threads:[~2020-12-21 13:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21  4:33 Anthony Martin
2020-12-21 13:08 ` cinap_lenrek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7C972FA346E83CE34B2349FC63E619E9@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).