I/O internals question

Management of storage subsystems: SAN, volume shadowing, logical disks, file systems, and more.
Post Reply

Topic author
mberryman
Active Contributor
Posts: 40
Joined: Sat Sep 02, 2023 1:31 pm
Reputation: 0
Location: Colorado Springs, CO, USA
Status: Offline

I/O internals question

Post by mberryman » Mon Jun 17, 2024 8:17 am

I have a need to retrieve data from a disk considerably larger than 2TB. Is there any way to issue an I/O request to the disk driver (in this case, sys$dkdriver) that would include a 64-bit block number, or are such requests always truncated to 32-bits? For example, I tried issuing an IO$_READLBLK with a P3 parameter of 4294967297. The read succeeded but the data I got back was from block number 1 (4294967297 = hex 100000001). I need to be able to read up to block number 64452862807.


pjacobi
VSI Expert
Active Contributor
Posts: 29
Joined: Wed Jun 28, 2023 11:46 am
Reputation: 0
Status: Offline

Re: I/O internals question

Post by pjacobi » Mon Jun 17, 2024 10:44 am

What version of VMS are you using? The last set of 64-bit LBN changes were in the last IA64 version and in X86 versions but not sure how much they were tested.


Paul A. Jacobi
VMS Software
Last edited by pjacobi on Mon Jun 17, 2024 11:00 am, edited 1 time in total.


Topic author
mberryman
Active Contributor
Posts: 40
Joined: Sat Sep 02, 2023 1:31 pm
Reputation: 0
Location: Colorado Springs, CO, USA
Status: Offline

Re: I/O internals question

Post by mberryman » Mon Jun 17, 2024 12:38 pm

On IA64 I am using 8.4-2L3.
On x86_64 I am using 9.2-2 update 2.


roberbrooks
VSI Expert
Active Contributor
Posts: 49
Joined: Thu Jun 20, 2019 11:48 am
Reputation: 0
Status: Offline

Re: I/O internals question

Post by roberbrooks » Mon Jun 17, 2024 8:18 pm

Paul Jacobi wrote . . .

> The last set of 64-bit LBN changes were in the last IA64 version and in
> X86 versions but not sure how much they were tested.

The IA64 changes went into the never-shipped V8.5 code base, which became the basis
of the X86 stuff.

The 64-bit LBN changes definitely will not work on any IA64 version.
--
-- Rob


pjacobi
VSI Expert
Active Contributor
Posts: 29
Joined: Wed Jun 28, 2023 11:46 am
Reputation: 0
Status: Offline

Re: I/O internals question

Post by pjacobi » Tue Jun 18, 2024 3:12 pm

Be sure to #define __NEW_STARLET 1

Make sure P3 is __int64 and any 64-bit constants are LL, i.e. x=0x0123456789ABCDEFLL.

Your only hope would be to try this on an X86 VMS.


Paul Jacobi
VMS Software


Topic author
mberryman
Active Contributor
Posts: 40
Joined: Sat Sep 02, 2023 1:31 pm
Reputation: 0
Location: Colorado Springs, CO, USA
Status: Offline

Re: I/O internals question

Post by mberryman » Tue Jun 18, 2024 7:26 pm

Is that all there is? Using the following test program, both reads return block 1. The test was performed on an x86_64 system running v9.2-2.

Code: Select all

#define __NEW_STARLET 1
#include <starlet.h>
#include <descrip.h>
#include <iodef.h>
#include <efndef.h>
#include <iosbdef.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>

static $DESCRIPTOR( hfs_device, "$1$DGA100:" );

struct _io_blk {
    char        *buffer;
    int64_t     byteCount;
    int64_t     blockNum;
    IOSB        iosb;
    uint16_t    channel;
};

static uint32_t
perform_io(struct _io_blk *ioblk)
{
    uint32_t status;

    status = sys$qiow( EFN$C_ENF, ioblk->channel, IO$_READLBLK, &ioblk->iosb, 0, 0,
        ioblk->buffer,                          //p1 - buffer address
        ioblk->byteCount,                       //p2 - length of read
        ioblk->blockNum,                        //p3 - logical block #
        0,                                      //p4
        0,                                      //p5
        0                                       //p6
    );
    if ( status & 1 ) status = ioblk->iosb.iosb$w_status;
    return( status );
}

int main()
{
    uint64_t *ptr;
    uint32_t status;
    struct _io_blk ioblk;

    status = sys$assign( &hfs_device, &ioblk.channel, 0, 0);
    if (!(status & 1)) return(status);
    ioblk.buffer = malloc(512);
    ioblk.byteCount = 512;
    ioblk.blockNum = 1LL;
    if (!(status = perform_io(&ioblk) & 1)) return(status);
    ptr = (uint64_t *)ioblk.buffer;
    printf("%llx\n", *ptr);
    ioblk.blockNum = 4294967297LL;
    if (!(status = perform_io(&ioblk) & 1)) return(status);
    printf("%llx\n", *ptr);

    sys$dassgn( ioblk.channel );
    return(0);
}
$ run test
5452415020494645
5452415020494645
$


Topic author
mberryman
Active Contributor
Posts: 40
Joined: Sat Sep 02, 2023 1:31 pm
Reputation: 0
Location: Colorado Springs, CO, USA
Status: Offline

Re: I/O internals question

Post by mberryman » Thu Jun 20, 2024 12:16 pm

I was never able to get this to work using IO$_READLBLK. However, with IO$_DIAGNOSE I am able to issue a SCSI READ(16) command which gives me access to all 30TB of the disk. This works on both Integrity and x86_64 (I haven't yet tried it on Alpha but would expect it to work there as well). I am now successfully copying all of the files off of that disk at a rate of around 85 MB/sec. It does show that I/O is still faster on Integrity than on x86_64 but, since both the source and target disks are on the same raid array in the SAN and the Integrity host only has a 4G HBA, I am happy with that transfer rate.


pjacobi
VSI Expert
Active Contributor
Posts: 29
Joined: Wed Jun 28, 2023 11:46 am
Reputation: 0
Status: Offline

Re: I/O internals question

Post by pjacobi » Thu Jun 20, 2024 5:30 pm

5452415020494645 is ASCI for "EFI PART". That probably the Global Partition Table at block 1. It is also copied to the last block of the disk as a backup.

Paul Jacobi
VMS Software


Topic author
mberryman
Active Contributor
Posts: 40
Joined: Sat Sep 02, 2023 1:31 pm
Reputation: 0
Location: Colorado Springs, CO, USA
Status: Offline

Re: I/O internals question

Post by mberryman » Thu Jun 20, 2024 5:48 pm

Understood. It was the fact that when I read blocks 1 and 4294967297 and both returned the global partition table at block 1 that told me that QIO was truncating P3 to 32-bits and not treating it as a 64-bit number. (The low-order 32-bits of the 64-bit number 4294967297 is 1).

Post Reply