Operating System - OpenVMS
1753786 Members
7772 Online
108799 Solutions
New Discussion юеВ

Adjusting the pgflquota of a running process

 
Alf Kellner
New Member

Adjusting the pgflquota of a running process

Hi,

Is there a way (either from DCL or a system call from within a C program) to increase the page-file quota of a running process, similar to what can be done via AMDS.

Process is running on V7.3-1 Alpha VMS.
8 REPLIES 8
Karl Rohwedder
Honored Contributor

Re: Adjusting the pgflquota of a running process

Alf,

have a look at the QAPQ utility here:

http://www.quadratrix.be/qapq.html

regards Kalle
Alf Kellner
New Member

Re: Adjusting the pgflquota of a running process

Thanks Kalle, this will do the trick.

Cheers,
Alf.
labadie_1
Honored Contributor

Re: Adjusting the pgflquota of a running process

Amds or Availability Manager will do it too, for any quota.

http://h71000.www7.hp.com/openvms/products/availman/index.html
Karl Rohwedder
Honored Contributor

Re: Adjusting the pgflquota of a running process

Labadie,

he knew AMDS already:

... similar to what can be done via AMDS.

regards kalle
John Gillings
Honored Contributor

Re: Adjusting the pgflquota of a running process

Alf,

*WARNING WARNING WARNING*
This posting contains PRIVILEGED code which performs UNSYNCHRONIZED ACCESS to kernel data structures. It's a bit like a high powered chainsaw - used correctly it can be extremely useful, but used carelessly, the results can be very messy and often fatal! Do not attempt to use this method if you don't completely understand how it works and the potential consequences!


If you're really desperate, and prepared to take a calculated risk, you can adjust most quotas stored in the JIB by writing a short MACRO32 program. In "emergency" circumstances just ignore all the usual locking requirements and blast in the new values to the appropriate cells.

First work out the address of the cell in the JIB. Use SDA:

SDA> READ SYSDEF
SDA> SET PROCESS/INDEX=process-index
SDA> SHOW PROCESS
SDA> FORMAT JIB

In your case you need to adjust BOTH PGFLQUOTA and PGFLCNT, (you must always adjust both the quota and the count by the same amount) so look for:
...
FFFFFFFF.8172F2FC JIB$L_TQLM 000000C8
FFFFFFFF.8172F300 JIB$L_PGFLQUOTA 0000F424
FFFFFFFF.8172F304 JIB$L_PGFLCNT 0000F145
FFFFFFFF.8172F308 JIB$L_CPULIM 00000000
...

Record the address of the first cell, just the low 32 bits, in this case 8172F300

Now the MACRO32 program

.TITLE fix
.PSECT code,rd,nowrt,exe
.ENTRY start,^M<>
$CMKRNL_S priv
RET
.ENTRY priv,^M<>
MOVL ^X8172F300,R1 ; Address of first cell
ADDL2 #1000,(R1)+ ; first operand is amount to increase quota
ADDL2 #1000,(R1) ; Repeat for count, same value
MOVL #1,R0
RET
.END start

Compile link and run. There must be no errors from the compile or link. You should find the quota has been increased. Most of the times I've done this it's been to increase BYTLM or TQELM to get a process out of MUTEX state. In those cases, you need to tap the process on the shoulder to make it notice the change, SDA> SHOW PROCESS/CHAN works well.

I always write these programs with hardcoded addresses and delete them afterwards - they're only relevant for a specific process at the specific time they're used.

I've done this many times, mostly dictating the program over a phone. I only ever lost one system, and that was because the person at the other end left out one instruction - the second ADD (even though he read it back to me!).

In theory you could write the same program in C, but anything you run in kernel mode you need to know PRECISELY what instructions are executed, and can't call things like the CRTL. It would probably also be more code to type. Besides MACRO32 is available on all systems and can be used without a PAK.
A crucible of informative mistakes
Ian Miller.
Honored Contributor

Re: Adjusting the pgflquota of a running process

John G, If you are going to do that why not use DELTA ?
____________________
Purely Personal Opinion
Jan van den Ende
Honored Contributor

Re: Adjusting the pgflquota of a running process

Ian,

I second that -- DELTA has saved us on several occasions.
Although I appriciate one advantage of John's way: You can check and double-check before the actual issuing, and with DELTA you had better NOT make typos!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
John Gillings
Honored Contributor

Re: Adjusting the pgflquota of a running process

Ian, Jan,

I've tried DELTA, but found it unreliable for two reasons. First, you need to update BOTH cells, and prompt/type/parse/execute is MUCH slower than two consecutive instructions (even if you load them into a paste buffer).

I guess the safe way to update the cells in DELTA is to do them backwards (ie: update the count before the limit)

Second, in the cases I've dealt with (mostly MUTEX hung waiting for BYTLM), sometimes the process has been hung so long, it's been swapped out. DELTA seems to require the memory to be resident. Perhaps not a problem these days.

Then there's the confidence thing, I have trouble trusting a utility who's only error message is "eh?".



A crucible of informative mistakes