9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Miller <9fans@hamnavoe.com>
To: 9fans@9fans.net
Subject: Re: [9fans] Race condition in /sys/src/9/pc/trap.c?
Date: Fri, 31 Jul 2009 14:28:42 +0100	[thread overview]
Message-ID: <692aeda5a7371fbdafc5a64e0eca1975@hamnavoe.com> (raw)
In-Reply-To: <fae87e311a68cf665cb109c17d5213c9@terzarima.net>

> ... procflushseg finds all processes that share s, sets them all up
> to flush their mmu states, and also sets any processor running such a process
> to flush its state (that's picked up by a clock interrupt).
>
> procflushseg will not proceed until all processes and processors that
> might need to flush state have done so. (s remains locked throughout.)

Coincidentally, I spent last Sunday debugging a deadlock in precisely
this spot.  I had absentmindedly tried to use VESA vga on a multiprocessor.
The aux/vga -l apparently succeeded and the screen looked great, but
as a stealthy side-effect the CPU which had done the VESA call stopped
responding to interrupts -- including the local APIC clock interrupt
required for the mmu flush as described above.

So, some time later when another process (upas/fs as it happens) on
the other CPU wanted to adjust a segment size, procflushseg was called
and never returned.

Debugging can be challenging when cause and effect are minutes or
hours apart ...




  reply	other threads:[~2009-07-31 13:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30  4:03 Matthew J Jones
2009-07-30 11:27 ` erik quanstrom
2009-07-30 14:25   ` Elizabeth Jones
2009-07-30 14:37     ` Sape Mullender
2009-07-30 15:01       ` cinap_lenrek
2009-07-30 15:24         ` cinap_lenrek
2009-07-30 15:17       ` cinap_lenrek
2009-07-30 15:54         ` Charles Forsyth
2009-07-31 13:07           ` Charles Forsyth
2009-07-31 13:28             ` Richard Miller [this message]
2009-07-31 17:13             ` cinap_lenrek
2009-07-31 18:00               ` erik quanstrom
2009-07-31 18:08                 ` Devon H. O'Dell
2009-07-31 18:18                   ` erik quanstrom
2009-07-31 18:35                     ` Devon H. O'Dell
2009-07-31 21:52                 ` cinap_lenrek
2009-07-31 19:31               ` Charles Forsyth
2009-07-31 19:40                 ` erik quanstrom
2009-07-31 20:41                   ` Charles Forsyth
2009-07-30 15:20       ` erik quanstrom
2009-07-30 14:39     ` erik quanstrom

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=692aeda5a7371fbdafc5a64e0eca1975@hamnavoe.com \
    --to=9fans@hamnavoe.com \
    --cc=9fans@9fans.net \
    /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).