[Info-vax] OpenVMS async I/O, fast vs. slow

Johnny Billquist bqt at softjar.se
Mon Nov 6 06:16:45 EST 2023


On 2023-11-04 18:06, Craig A. Berry wrote:
> 
> On 11/4/23 6:11 AM, Johnny Billquist wrote:
> 
>> I'm not sure I have ever understood why people think memory mapped 
>> files would be faster than a QIO under VMS.
> 
> I might've missed it but I haven't seen anyone say that. It's that
> global sections are faster than mailboxes. The I/O API may be a
> consideration but is secondary to the nature of the device.

I think I've seen plenty of suggestions that memory mapped I/O would be 
a performance enhancer in VMS. Probably based on the fact that it is 
under Unix.

>> With memory mapped I/O, what you essentially get is that I/O transfers 
>> go directly from/to disk to user memory with a single operation. There 
>> are no intermediate buffers, no additional copying. Which is what you 
>> pretty much always have otherwise on Unix systems.
>>
>> However, a QIO under VMS is already a direct communication between the 
>> physical memory and the device with no intermediate buffers, 
>> additional copying or whatever, unless I'm confused (and VMS changed 
>> compared to RSX here...).
>>
>> So how would memory mapped I/O be any faster? You basically cannot be 
>> any faster than one DMA transfer. In fact, with memory mapped I/O, you 
>> might be also hitting the page fault handling, and a reading in of a 
>> full page, which might be more than you needed, causing some overhead 
>> as well.
> 
> I doubt that QIO with most device drivers is a simple as you make it out
> to be. Last I heard they use Intermediate Request Packets (IRPs) and
> other system resources in addition to the buffer space in the user
> program. And in any case, QIO is limited to transfer sizes that these
> days are considered pretty small.

I admit that I based this on how the QIO is processed in RSX. I wouldn't 
expect VMS to do it much differently, but I haven't looked at the VMS code.

The IRP is basically the internal storage/representation of the QIO that 
the kernel use, unless I'm confused. And yes, that have to be allocated. 
(In RSX you have a bunch of these preallocated for efficiency). Size 
limitation I can possibly see a bit of a thing with. I guess it's still 64K.

But that's pretty much it.

>> Also, what do $IO_PERFORM do, that could possibly make it faster than 
>> QIO?
>>
>> I'm really curious about this topic...
> 
> There's a pretty good explanation in the manual:
> 
> https://docs.vmssoftware.com/vsi-openvms-programming-concepts-manual-volume-ii/#FAST_IO_PATH

Thanks. Very enlightning. So basically:
1. Preallocated IRPs.
2. Constantly locked memory, thus avoiding the unlock/lock bits.
3. Quick I/O completion.

It does make it sound like QIO in VMS would use an intermediate buffer. 
Which is perhaps the most interesting bit. So IOPERFORM is closer to 
what QIO does under RSX.

Thanks.

   Johnny




More information about the Info-vax mailing list