Let me try a different example than Mike's 'Q DASD DETAILS 0-FFFF': Suppose you 
are writing software for disaster recovery of LVM disks. The Linux that owned 
them will not come up so you link them from another Linux. Get a list of 
minidisk addresses and their owners and issue LINK against each. LINK needs a 
local virtual address that is also free. You don't know who will be using this 
so this needs to work in any configuration. You can ask the user to provide a 
range in a config file, but it would be nicer if you could find the range 
automatically. You could run QUERY VIRTUAL and find which virtual addresses are 
occupied. Once you start doing this, you run QUERY VIRTUAL every time you need 
to find free address, i.e. even when you have a few minidisks linked.
But at this point you realize that you program is unreliable because it can 
occasionally fail due to memory fragmentation, because to list all the used 
virtual addresses you need a large contiguous buffer in the kernel. What people 
wrote about reading the response of vmcp and enlarging the buffer if needed 
helps in the average scenario but does not help the worst case scenario. So if 
you are using vmcp in critical code you have to be very careful about keeping 
buffers small. It would be nice if this was not necessary, i.e. if there was a 
way to run DIAG 8 without the need for contiguous buffer.

Tomas

Reply via email to