presto.4

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 4 代码 · 共 491 行 · 第 1/2 页

4
491
字号
.TH presto 4.SH Namepresto \- the Prestoserve pseudodevice driver.SH Syntax.nf.ft B#include <sys/presto.h>#include <sys/prestoioctl.h>pseudo-device	presto.fi.ft R.SH Description.NXR "presto pseudodevice driver"The Prestoserve pseudodevice driver .PN presto caches synchronous writes in nonvolatile memory.  Prestoserve causes synchronous writes to be performed at memory speeds, rather than at disk speeds.Synchronous writes that result in Prestoserve cache hits do not perform theearlier physical disk writes, because only the last write is actually performed by Prestoserve.  Therefore, 50% to 65% of all the physical diskwrite operations are avoided, because every sequential NFS write to a file also causes the inode and the indirect block to be synchronously written..PPThe.PN presto driver is layered on other disk drivers, andit intercepts the other drivers' I/O requests by replacing the entry points of the original driver in the bdevsw and cdevsw tables. The .PN prestodriver caches the intercepted synchronous write requests in the Prestoserve cache's nonvolatile memory.When Prestoserve needs to perform actual I/O, it calls the original driver's entry points to perform the I/O.  A modified form ofLeast Recently Used (LRU) replacement determines when the Prestoserve cache data needs to be written to the intended disks..PPAn accelerated disk device (one that has the .PN prestopseudodevice driver layered on top of its driver),uses the same major and minor devices that it used before it was accelerated..PPThe Prestoserve nonvolatile memory must be found at boot time in order for Prestoserve to perform its write-caching function.In addition, Prestoserve must pass diagnostic tests, andthere must be sufficient backup battery power to guarantee a reasonableamount of cache data stability (measured in days or weeks) in the event of a power or hardware failure.See the appropriate appendix in the \fIGuide to Prestoserve\fPfor information on specific processors..PPIf the Prestoserve nonvolatile memory is not found or if there is not enough backup battery power, then the disks are not accelerated; howeverthey can be opened and used as usual.  In this case, the.PN prestodriver simply passes all I/O requests directly through to the appropriate device..SS OperationWhen Prestoserve is in the PRUP state, it caches all synchronous write requests for enabled file systems and block devices to the.PN prestodriver in nonvolatile memory and writes the Prestoserve cache data asynchronously to the intended disks.  .PPWhen Prestoserve is in thePRDOWN state, there is no data in the Prestoserve cache, no data is put into the Prestoserve cache, and all disk requests are passed directly to the real disk driver..PPWhen Prestoserve is in the PRERRORstate, the data in the Prestoserve cache can not be written to theintended disks because of a disk, system, or hardware error.  .PPWhen the system is shut down normally by using the.PN rebootsystem call from the .PN shutdown ,.PN halt ,or.PN reboot command, the Prestoserve cache data is written tothe intended disks, and Prestoserve enters the PRDOWN state.This allows you to fix any system or disk error or to upgrade or changeyour system without losing the data in the Prestoserve cache orcorrupting your disks..PPIf your system was shut down without following normal shutdownprocedures, and you reboot the system, any data in the Prestoservecache is written to the intended disks, if possible.  If the data is successfully written to the intended disks (and if the nonvolatile memory and backup battery passed the diagnostic tests), Prestoserve enters the PRDOWN state.  If an error occurs, Prestoserve enters the PRERROR state..NTData can exist in the Prestoserve cache after you reboot the system only in the event of a previous power failure, disk device error,or kernel crash that resulted from a software or hardware problem..NE.PPIf an error from a disk device occursor if the backup battery power is insufficient, Prestoservewrites the cache data to the intended disks, if possible, and enters the PRERROR state.  When Prestoserve is in the PRERRORstate,  new data that is written to a block not found in the Prestoservecache is passed directly to the real disk driver.If new data is written to a block that is found in the cache,Prestoserve replaces the existing block and attempts to write the block to the real disk driver to determine if the error condition on that block still exists.If the write is successful and if all the  Prestoserve cache data can be written to the intended disks, Prestoserve leaves thePRERROR state..PPThe Prestoserve cache never discards data without being explicitly told to do so by using a PRRESET ioctl command.  This can be done by using the .PN "presto -R"command.  This command should only be used when there is a fatal disk errorand when the data is not important.  .SS ioctl CommandsThe.PN prestopseudodevice driver does not intercept ioctlcommands;  they go directly to the actual disk driver.  The following ioctl commands can be performed on the Prestoserve control device.PN /dev/pr0 .Some ioctl commands affect all of Prestoserve operation,while others only affect a particular accelerated file system..TP PRGETSTATUSThe argument to ioctlis a pointer to a.B "presto_status" structure, which contains battery status information, Prestoservestate, current and maximum nonvolatile memory sizes, and various Prestoservestatistics..TPPRSETSTATEThe argument to ioctl is a pointer to an.BR int .The.B intcan be either PRUPto enable Prestoserve or PRDOWNto disable Prestoserve.  When a system reboots, Prestoserve is in thePRDOWN state and must be explicitly enabled by an ioctl.You enable Prestoserve by using the .PN "presto \-u" command, which can be placed in the .PN /etc/rc.localfile.   When Prestoserve goes from the PRDOWNstate to the PRUPstate, the Prestoserve I/O statistics are reset.  When Prestoservegoes from the PRUP state to the PRDOWN state, all the Prestoservebuffers are written to the intended disks, and the buffers are invalidated..TPPRSETMEMSZThe argument to ioctl is a pointer to an.BR int .This.B intis the size in bytes of the Prestoserve nonvolatile memory to be used.This size cannot be larger than the maximum size reported in the.B presto_statusstructure..TPPRRESETThe argument to ioctl is ignored.  Like the PRSETSTATEioctl, PRRESETsets the Prestoserve state to PRDOWN,but it also reinitializes all of nonvolatile Prestoserve memory.  If Prestoserve was in the PRERRORstate and some Prestoserve buffers could not be writtento the intended disks because of disk I/O errors, the data in the buffers is lost.This is the only method you can use to force Prestoserve to discard data that cannot be written to disk, and it can be accomplished byusing the .PN "presto -R"command..TPPRFLUSHThe argument to ioctl is ignored.All the data in the Prestoserve buffers is written to the intended disks, but the buffers are not invalidated. This command can be used by a daemon that flushes the cache periodically to minimize the risk to data in the event of acatastrophic failure.  The cache data can be flushed to the intendeddisks by using the .PN "presto -F"command..TPPRGETUPRTABThe argument to ioctl is a pointer to a.BR "struct uprtab" .On input, the field.B upt_bmajordevspecifies the block device major number of the device whose.B "struct uprtab"should be returned.  The field.B upt_bmajordevis set to .B NODEV ,which is defined in the header file .PN <sys/param.h> ,if the requested device does not exist or if it is not accelerated.  The.B "struct uprtab"contains a .B upt_enabled field that is a bit vector indexed by a minor device number and that indicates whether the minor device number has Prestoservecaching enabled..TPPRNEXTUPRTABThe argument to ioctl is a pointer to a.BR "struct uprtab" .This ioctl returns the.B "struct uprtab"for the accelerated device with thesmallest block device major number that is greater than the.B bmajordevfield of the.B "struct uprtab"argument.  This allows each accelerated device's.B "struct uprtab"to be retrieved sequentially by specifying the previous device's block device major number. To get the first accelerated device's.BR "struct uprtab" ,set the.B upt_bmajordevfield to.B NODEV .  Use the same.B "struct uprtab"that was returned on the previous call for the next call.When the.B upt_bmajordevfield of the argument.B "struct uprtab"is greater than or equal to the last accelerateddevice's major block device number, the.B "struct uprtab"that is returned has the.B upt_bmajordevfield set to.BR NODEV .

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?