9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: ron minnich <rminnich@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] 9vx (is this the right list)? import issue
Date: Tue, 22 Sep 2009 11:21:33 -0700	[thread overview]
Message-ID: <13426df10909221121g5d203f06qeabf4356940d1193@mail.gmail.com> (raw)
In-Reply-To: <13426df10909221027u4279cd72hf7b651dfd120339b@mail.gmail.com>

OK, I did this in mntralloc, in the code path in which we reuse the
rpc from the mtnalloc.rpcfree: I just simply always allocated a new
tag, even if we found an old rpc which was nominally free: I always
allocated a new tag, not reusing the old tag.

That fixed the problem.

So, basically, the way I see it is, grep proc gets an interrupt,
kernel will try to flush RPCs which we initiated, we drop the (we
think) flushed rpc struct onto the rpcfree list, but the reply from
the server is still in flight. We reuse the rpc from rpcfree list, we
send out a new T, with the same tag as the previous one which we think
we flushed, we get the reply from the earlier RPC, tags match, R does
not match T, bad day.

This is the same code as is in plan 9.

There's harder and harder ways to deal with this, I have some ideas
but I expect some of the folks on this list to have better ones. The
simplest one that would probably work is to avoid reusing tags quite
so quickly. Free tags, yes, but use a counter to indicate "next tag to
use", so that it's a relatively long time before a tag for a mount
point is reused again. So, e.g., we free tag 3, but the next tag we
allocate is tag 4, and so on. Sooner or later we'll use tag 3 again,
likely long after any messages in flight have been retired. (weirdly
enough, I saw a trick like this used in hardware many years ago ...)

That may not be good enough, not sure. It's definitely pretty easy to
implement.

What I observed is that when this is all working, tag 3 is the only
tag ever used!

ron



  reply	other threads:[~2009-09-22 18:21 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21 18:29 ron minnich
2009-09-22  5:51 ` Russ Cox
2009-09-22 17:27   ` ron minnich
2009-09-22 18:21     ` ron minnich [this message]
2009-09-22 18:35       ` roger peppe
2009-09-22 18:47         ` ron minnich
2009-09-22 18:58           ` roger peppe
2009-09-22 19:08           ` Eric Van Hensbergen
     [not found] <<13426df10909221147w665e30adt93b6121281294647@mail.gmail.com>
2009-09-22 18:51 ` erik quanstrom
     [not found] <<df49a7370909221158u3f071cc3j125c85241c5088e6@mail.gmail.com>
2009-09-22 19:01 ` erik quanstrom
2009-09-22 19:34   ` roger peppe
2009-09-22 21:12     ` ron minnich
2009-09-22 21:20       ` ron minnich
     [not found] <<13426df10909221420x1298139fhdeb4f0803924e5a3@mail.gmail.com>
2009-09-22 21:23 ` erik quanstrom
2009-09-22 22:32   ` ron minnich
     [not found] <<13426df10909221532t5de9f010pfeb2ca2c3b44db89@mail.gmail.com>
2009-09-23  2:36 ` erik quanstrom
     [not found] <<fadaba2046122acf656140c0618e1d1e@ladd.quanstro.net>
2009-09-23  2:41 ` erik quanstrom
2009-09-23  3:11   ` Russ Cox
     [not found] <<dd6fe68a0909222011u4243953dged01d77ecdc93e46@mail.gmail.com>
2009-09-23  3:17 ` erik quanstrom
2009-09-23  4:11   ` Russ Cox
     [not found] <<dd6fe68a0909222111y1af0f4a2qd30a3b4eded30b2b@mail.gmail.com>
2009-09-23  4:56 ` erik quanstrom
2009-09-23 18:52   ` Russ Cox
2009-09-23 19:12     ` ron minnich
2009-09-23 19:25       ` erik quanstrom
2009-09-23 19:26       ` Russ Cox
2009-09-23 20:33         ` ron minnich
2009-09-23 20:35           ` ron minnich
2009-09-23 22:13             ` Russ Cox
2009-09-23 21:25     ` 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=13426df10909221121g5d203f06qeabf4356940d1193@mail.gmail.com \
    --to=rminnich@gmail.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).