* Require help with msync() functionality in OpenVMS Cluster env.
@ 1999-12-06 5:00 Simon Maslin
1999-12-18 5:00 ` Roger Tucker
0 siblings, 1 reply; 4+ messages in thread
From: Simon Maslin @ 1999-12-06 5:00 UTC (permalink / raw)
I am analysing applications that use shared memory (global sections) mapped
to a disk file to allow access to information on one machine to a similar
application on another machine. Both are running within a OpenVMS Alpha
cluster.
Using msync() to synchronise disk & memory.
How exactly does the msync() call actually synchronise the cluster-wide
applications that are mapped to the disk file ?
More importantly, how and when are the writes/reads on each machine actually
performed and is there anything to look-out for ?
Thanks for any assistance,
Simon Maslin.
Please reply to:- Simon.Maslin@dlr.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Require help with msync() functionality in OpenVMS Cluster env.
1999-12-06 5:00 Require help with msync() functionality in OpenVMS Cluster env Simon Maslin
@ 1999-12-18 5:00 ` Roger Tucker
1999-12-21 5:00 ` Hoff Hoffman
0 siblings, 1 reply; 4+ messages in thread
From: Roger Tucker @ 1999-12-18 5:00 UTC (permalink / raw)
This may not answer all of your questions but maybe it will be a
start. msync() calls one of the sys$updsec() system service
routines (SYS$UPDSEC(), SYS$UPDSECW(), $UPDSEC_64, or SYS$UPDSEC_64W)
depending on the flags argument being set to MS_ASYNC and
depending on if the section is a 32 bit or 64 bit section.
You can read about theses services from the system service
reference manual. But they flush any modified pages out to the
disk file.
If you also specify MS_INVALIDATE msync() uses a VMS LOCK and
lock value block to notify other nodes that the section is invalid.
This is done by taking out an exclusive lock, incrementing a
sequence number in the lock value block, and converting the
block back to NL mode. The other processes that have the global
section mapped wait on a blocking-ast. If they don't have AST's
disabled they will invalidate their copy of the global section
and fault it from the disk the next time they read it. Two locks
are used in real-life (a door bell lock and sequence number lock)
to avoid a problem of a process being hung or having AST's off.
The writes/reads on each machine are not synchronised. That
is up to your application, but MS_INVALIDATE will force the next
read on any node to get the new data from disk. <For example
does read I/O on the second machine hold-up write I/O on the first
machine ?> NO. That is up to your application.
I hope this is enough information to help.
Thanks,
Roger Tucker - MCIWorldCom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Require help with msync() functionality in OpenVMS Cluster env.
1999-12-18 5:00 ` Roger Tucker
@ 1999-12-21 5:00 ` Hoff Hoffman
1999-12-23 5:00 ` Roger Tucker
0 siblings, 1 reply; 4+ messages in thread
From: Hoff Hoffman @ 1999-12-21 5:00 UTC (permalink / raw)
In article <385A6F18.277AE9D2@mci.com>, Roger Tucker <roger.tucker@mci.com> writes:
:This may not answer all of your questions but maybe it will be a
:start. msync() calls one of the sys$updsec() system service
:routines (SYS$UPDSEC(), SYS$UPDSECW(), $UPDSEC_64, or SYS$UPDSEC_64W)
:depending on the flags argument being set to MS_ASYNC...
:If you also specify MS_INVALIDATE msync() uses a VMS LOCK and
:lock value block to notify other nodes that the section is invalid....
I just looked at the C RTL code for msync and don't see any locking
activity... I didn't follow the sys$updsec* code down deep into the
executive, but one of the other locals followed it as far as the XQP...
:The writes/reads on each machine are not synchronised. That
:is up to your application, but MS_INVALIDATE will force the next
:read on any node to get the new data from disk. <For example
:does read I/O on the second machine hold-up write I/O on the first
:machine ?> NO. That is up to your application.
..
I've been chatting with the C RTL engineer and with one of the local
OpenVMS memory management gurus. I'm completely baffled about the
abovementioned solution -- neither the C RTL nor the global section
system services handle access to the shared memory from multiple nodes
within a cluster. Across accessors on the same node, yes...
My recollection is that shared memory is node-local. Further, the
backing storage accesses "behind" shared memory section updates are
not coordinated across cluster nodes, hence updates can be lost...
Unless there's something really nifty happening deep inside the XQP
or the I/O subsystem here that none of us know about or remember, I
don't see how this approach would be reliable...
If you handle your own intra-cluster communications, you could work
out a scheme where the information was distributed to the shared
memory of other cluster members. (Or of course -- if this was an
OpenVMS Galaxy configuration -- you could use galactic memory...)
If the above discussion intends to describe the creation of your
own intra-cluster protocol (based on the lock manager) to coordinate
the updates, then that might be feasible... (I'd want to watch for
the potential of some interesting timing issues on the completions
of the updates to the backing section. And I'd take a serious look
at just passing over the information, via an application network
protocol connection or via RTR or otherwise -- the "fun" part comes
in because there isn't really any direct control over when OpenVMS
decides to write pages of the memory information out to the backing
storage, and this I/O can occur in the absence of an $updsec call.)
We do need to update the msync documentation as well as the various
shared memory documentation -- I've passed along that report to the
technical writers for inclusion into the next release of the OpenVMS
programming concepts and system service reference manuals...
--------------------------- pure personal opinion ---------------------------
Hoff (Stephen) Hoffman OpenVMS Engineering hoffman#xdelta.zko.dec.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Require help with msync() functionality in OpenVMS Cluster env.
1999-12-21 5:00 ` Hoff Hoffman
@ 1999-12-23 5:00 ` Roger Tucker
0 siblings, 0 replies; 4+ messages in thread
From: Roger Tucker @ 1999-12-23 5:00 UTC (permalink / raw)
I'm not sure what source code Stephen Hoffman is looking at, but
my source code for msync() on the VMS 7.1 source distribution
performs locking.
I'm looking at the file [v71.acrtl.lis]mmap.lis. I cannot post the
source code, but msync() calls force_invalidate() if (flags &
MS_INVALIDATE). force_invalidate() increments a sequence number in the
lock value block of a lock, remaps the section, then calls ring_bell().
ring_bell() notifies other processes by taking out an excluseive
lock, then reverts it back to concurrent read. All other processes
that have the current region mapped are have a blocking ast pending.
I haven't tested this across the cluster but it looks like it
would work. It's still up to the application to only have
one writer at a time, but the updates should be readable
by any other process that has the same section mapped on
the next access. If someone has an exmple they can post it, or
if I get time I'll write one.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1999-12-23 5:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-12-06 5:00 Require help with msync() functionality in OpenVMS Cluster env Simon Maslin
1999-12-18 5:00 ` Roger Tucker
1999-12-21 5:00 ` Hoff Hoffman
1999-12-23 5:00 ` Roger Tucker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox