9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "ibrahim via 9fans" <9fans@9fans.net>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] A few questions about 9p
Date: Sat, 5 Nov 2022 00:10:03 -0400	[thread overview]
Message-ID: <16676214030.bB1Ae.26874@composer.9fans.topicbox.com> (raw)
In-Reply-To: <CAP6exYJ5j+ZYK8Lz1ftdc2OeBxY4Dh-h3SR9=N0--ShH60K7iQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3061 bytes --]

On Saturday, 5 November 2022, at 12:41 AM, ron minnich wrote:
> I'd argue that this may be the most real-world-tested Tflush handler you'll see. I have seen Tflush handlers that just return, having done nothing, and it's possible that in many cases, that's good enough. But Chris's code is VERY heavily tested with real workloads.

I'm not surprised. Interrupting hardware access for a few kB and risking to damage the filesystem wouldn't be wise. 

On Saturday, 5 November 2022, at 12:41 AM, ron minnich wrote:
> I also know, as I saw it many times, that the Plan 9 kernel Tflush could at times get extremely confused. When we ported it to Akaros, we even saw cases where Tflush would run out of control and exhaust the XID space, sending flush after flush as fast as it could create them.
> 

The rule : 

"Should multiple Tflushes be received for a pending request, they must be answered in order. A Rflush for any of the multiple Tflushes implies an answer for all previous ones. Therefore, should a server receive a request and then multiple flushes for that request, it need respond only to the last flush."

and :

"A Tflush can never be responded to by an Rerror message."

should lead to a dead lock in this situation. Lets say the first Tflush arrived and got responded afterwards all the other Tflushes arrive and can't be responded so all ntags used by Tflush messages after the first can't be used by the client cause there are pending unanswered requests by the client. The server can never respond with an Rerror to a Tflush arriving out of order after the first Tflush got processed. 1) All ntags used for Tflush after the first are considered open. 2) A server can't even hint with an error for a Tflush with an inactive oldtag. Rerror with "error : noldtag invalid" would at least make the ntags reusable for the client. If the client code is conforming to the rules in man(5) Tflush messages can burn all possible ntag values (16 bit).


If 9P2000 won't change at least some changes to the effects of Tflush and handling without breaking compatibility would be possible :

1) If a response to one of sent Tflush messages is made all Tflush messages regarding oldtag are responded not only preceeding ones, cause only one Rflush or only one response to the oldtag is allowed by the server.

more important my suggestion :

2) Tflush also leads to a clunk of a fid. This lets the server decide if it will keep the changes or revert them.

Those two changes would build a "mini-transaction" enviroment :

Topen/Tcreate
==> starts a file transaction

Tflush
==> interrupt file operation for fid associated with oldtag, clunk the fid with a rollback

Tclunk
==> commit changes to the file

Tversion
==> rollback all open changes not commited in the previous session.





------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T04e11fe14739da68-Md0bfd4f48352cded476092f3
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 4492 bytes --]

  parent reply	other threads:[~2022-11-05  4:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 23:14 ibrahim via 9fans
2022-11-04 23:41 ` ron minnich
2022-11-05  1:32   ` ibrahim via 9fans
2022-11-05  4:10   ` ibrahim via 9fans [this message]
2022-11-05  4:30     ` ori
2022-11-05  6:30       ` ibrahim via 9fans
2022-11-05 14:09         ` ori
2022-11-05 15:50           ` ibrahim via 9fans
     [not found] <CAHL7psHNZrbQuFRz5grmXgR686o2e+-SX=tW6yxnfNaduec5NQ@mail.gmail.com>
     [not found] ` <CAHL7psGPf3z56wjZGJsSVCeEzHBJgtbt17nL-UNA8kXKM-mkuw@mail.gmail.com>
     [not found]   ` <CAHL7psFTR7G1N069XoqYkuxJ_P0TYzmXAZ752wVa=9BAOX0CQg@mail.gmail.com>
     [not found]     ` <CAHL7psEUjdaV9LABzRrHn1TLftF+moxWV563-tvK+7VLviKhRg@mail.gmail.com>
2015-01-29  9:04       ` Giacomo Tesio
2015-01-29 10:07         ` Charles Forsyth
2015-01-29 14:36           ` erik quanstrom
2015-01-29 14:41           ` Giacomo Tesio
2015-01-29 14:52             ` erik quanstrom
2015-01-29 14:54             ` cinap_lenrek
2015-01-29 15:46               ` Giacomo Tesio

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=16676214030.bB1Ae.26874@composer.9fans.topicbox.com \
    --to=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).