Multi-threaded write interface and methods for increasing the single file read and write throughput of a file server
First Claim
1. A method of operating a network file server for providing clients with concurrent write access to a file, the method comprising the network file server responding to a concurrent write request from a client by:
- (a) obtaining a lock for the file; and
then (b) preallocating a metadata block for the file; and
then (c) releasing the lock for the file; and
then (d) asynchronously writing to the file; and
then (e) obtaining the lock for the file; and
then (f) committing the metadata block to the file; and
then (g) releasing the lock for the file.
10 Assignments
0 Petitions
Accused Products
Abstract
A write interface in a file server provides permission management for concurrent access to data blocks of a file, ensures correct use and update of indirect blocks in a tree of the file, preallocates file blocks when the file is extended, solves access conflicts for concurrent reads and writes to the same block, and permits the use of pipelined processors. For example, a write operation includes obtaining a per file allocation mutex (mutually exclusive lock), preallocating a metadata block, releasing the allocation mutex, issuing an asynchronous write request for writing to the file, waiting for the asynchronous write request to complete, obtaining the allocation mutex, committing the preallocated metadata block, and releasing the allocation mutex. Since no locks are held during the writing of data to the on-disk storage and this data write takes the majority of the time, the method enhances concurrency while maintaining data integrity.
-
Citations
61 Claims
-
1. A method of operating a network file server for providing clients with concurrent write access to a file, the method comprising the network file server responding to a concurrent write request from a client by:
-
(a) obtaining a lock for the file; and
then(b) preallocating a metadata block for the file; and
then(c) releasing the lock for the file; and
then(d) asynchronously writing to the file; and
then(e) obtaining the lock for the file; and
then(f) committing the metadata block to the file; and
then(g) releasing the lock for the file. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A method of operating a network file server for providing clients with concurrent write access to a file, the method comprising the network file server responding to a concurrent write request from a client by:
-
(a) preallocating a block for the file; and
then(b) asynchronously writing to the file; and
then(c) committing the block to the file;
wherein the asynchronous writing to the file includes a partial write to a new block that has been copied at least in part from an original block of the file, and wherein the method includes checking a partial block conflict queue for a conflict with a concurrent write to the new block, and upon finding an indication of a conflict with a concurrent write to the new block, waiting until resolution of the conflict with the concurrent write to the new block, and then performing the partial write to the new block. - View Dependent Claims (14)
-
-
15. A method of operating a network file server for providing clients with concurrent write access to a file, the method comprising the network file server responding to a concurrent write request from a client by:
-
(a) preallocating a metadata block for the file; and
then(b) asynchronously writing to the file; and
then(c) committing the metadata block to the file;
wherein the method includes gathering together preallocated metadata blocks for a plurality of client write requests to the file, and committing together the preallocated metadata blocks for the plurality of client write requests to the file by obtaining a lock for the file, committing the gathered preallocated metadata blocks for the plurality of client write requests to the file, and then releasing the lock for the file. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23, 24)
-
-
25. A method of operating a network file server for providing clients with concurrent read and write access to a file, the method comprising the network file server responding to a concurrent write request from a client by:
-
(a) preallocating a metadata block for the file; and
then(b) asynchronously writing to the file; and
then(c) committing the metadata block to the file;
wherein the network file server includes disk storage containing a file system, and a file system cache storing data of blocks of the file, and the method includes the network file server responding to concurrent write requests by writing new data for specified blocks of the file to the disk storage without writing the new data for the specified blocks of the file to the file system cache, and invalidating the specified blocks of the file in the file system cache, and which includes the network file server responding to read requests for file blocks not found in the file system cache by reading the file blocks from the file system in disk storage and then checking whether the file blocks have become stale due to concurrent writes to the file blocks, and writing to the file system cache a file block that has not become stale, and not writing to the file system cache a file block that has become stale. - View Dependent Claims (26, 27, 28)
-
-
29. A method of operating a network file server for providing clients with concurrent read and write access to a file, the method comprising the network file server responding to a concurrent write request from a client by:
-
(a) preallocating a metadata block for the file; and
then(b) asynchronously writing to the file; and
then(c) committing the metadata block to the file;
wherein the method includes processing multiple concurrent read and write requests by pipelining the requests through a first processor and a second processor, the first processor performing metadata management for the multiple concurrent read and write requests, and the second processor performing asynchronous reads and writes for the multiple concurrent read and write requests. - View Dependent Claims (30, 31)
-
-
32. A method of operating a network file server for providing clients with concurrent write access to a file, the method comprising the network file server responding to a concurrent write request from a client by executing a write thread, execution of the write thread including:
-
(a) obtaining an allocation mutex for the file; and
then(b) preallocating new metadata blocks that need to be allocated for writing to the file; and
then(c) releasing the allocation mutex for the file; and
then(d) issuing asynchronous write requests for writing to the file;
(e) waiting for callbacks indicating completion of the asynchronous write requests; and
then(f) obtaining the allocation mutex for the file; and
then(g) committing the preallocated metadata blocks; and
then(h) releasing the allocation mutex for the file.
-
-
33. A network file server comprising storage for storing a file, and at least one processor coupled to the storage for providing clients with concurrent write access to the file, wherein the network file server is programmed for responding to a concurrent write request from a client by:
-
(a) obtaining a lock for the file; and
then(b) preallocating a metadata block for the file; and
then(c) releasing the lock for the file; and
then(d) asynchronously writing to the file; and
then(e) obtaining the lock for the file; and
then(f) committing the metadata block to the file; and
then(g) releasing the lock for the file. - View Dependent Claims (34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46)
-
-
47. A network file server comprising storage for storing a file, and at least one processor coupled to the storage for providing clients with concurrent write access to the file, wherein the network file server is programmed for responding to a concurrent write request from a client by:
-
(a) preallocating a block for the file; and
then(b) asynchronously writing to the file; and
then(c) committing the block to the file;
wherein the network file server includes a partial block conflict queue for indicating a concurrent write to a new block that is being copied at least in part from an original block of the file, and wherein the network file server is programmed for responding to a client request for a partial write to the new block by checking the partial block conflict queue for a conflict, and upon finding an indication of a conflict, waiting until resolution of the conflict with the concurrent write to the new block of the file, and then performing the partial write to the new block of the file. - View Dependent Claims (48)
-
-
49. A network file server comprising storage for storing a file, and at least one processor coupled to the storage for providing clients with concurrent write access to the file, wherein the network file server is programmed for responding to a concurrent write request from a client by:
-
(a) preallocating a metadata block for the file; and
then(b) asynchronously writing to the file; and
then(c) committing the metadata block to the file;
wherein the network file server is programmed for gathering together preallocated metadata blocks for a plurality of client write requests to the file, and committing together the preallocated metadata blocks for the plurality of client write requests to the file by obtaining a lock for the file, committing the gathered preallocated metadata blocks for the plurality of client write requests to the file, and then releasing the lock for the file. - View Dependent Claims (50)
-
-
51. A network file server comprising disk storage containing a file system, and a file system cache storing data of blocks of a file in the file system, wherein the network file server is programmed for responding to a concurrent write request from a client by:
-
(a) preallocating a metadata block for the file; and
then(b) asynchronously writing to the file; and
then(c) committing the metadata block to the file;
wherein the network file server is further programmed for responding to concurrent write requests by writing new data for specified blocks of the file to the disk storage without writing the new data for the specified blocks of the file to the file system cache, and invalidating the specified blocks of the file in the file system cache, and wherein the network file server is programmed for responding to concurrent read requests for file blocks not found in the file system cache by reading the file blocks from the file system in disk storage and then checking whether the file blocks have become stale due to concurrent writes to the file blocks, and writing to the file system cache a file block that has not become stale, and not writing to the file system cache a file block that has become stale. - View Dependent Claims (52, 53, 54)
-
-
55. A network file server comprising storage for storing a file, a first processor coupled to the storage for managing metadata of the file, and a second processor for performing asynchronous reads and writes to the file, wherein the network file server is programmed for responding to a concurrent write request from a client by:
-
(a) preallocating a metadata block for the file; and
then(b) asynchronously writing to the file; and
then(c) committing the metadata block to the file;
wherein the network file server is programmed for processing multiple concurrent read and write requests by pipelining the multiple concurrent read and write requests through the first and second processors. - View Dependent Claims (56, 57)
-
-
58. A network file server comprising storage for storing a file, and at least one processor coupled to the storage for providing clients with concurrent write access to the file, wherein the network file server is programmed with a write thread for responding to a concurrent write request from a client by:
-
(a) obtaining an allocation mutex for the file; and
then (b) preallocating new metadata blocks that need to be allocated for writing to the file; and
then(c) releasing the allocation mutex for the file; and
then(d) issuing asynchronous write requests for writing to the file;
(e) waiting for callbacks indicating completion of the asynchronous write requests; and
then(f) obtaining the allocation mutex for the file; and
then(g) committing the preallocated metadata blocks; and
then(h) releasing the allocation mutex for the file. - View Dependent Claims (59, 60)
-
-
61. A network file server comprising storage for storing a file, and at least one processor coupled to the storage for providing clients with concurrent write access to the file, wherein the network file server is programmed for responding to a concurrent write request from a client by:
-
(a) preallocating a block for writing to the file;
(b) asynchronously writing to the file; and
then(c) committing the preallocated block;
wherein the network file server also includes an uncached write interface, a file system cache, and a cached read-write interface, wherein the uncached write interface bypasses the file system cache for sector-aligned write operations, and the network file server is programmed to invalidate cache blocks in the file system cache including sectors being written to by the cached read-write interface.
-
Specification