]> git.ipfire.org Git - thirdparty/squid.git/commit
Support "appending" read/write lock state that can be shared by readers
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 7 Jun 2013 23:34:36 +0000 (17:34 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 7 Jun 2013 23:34:36 +0000 (17:34 -0600)
commitce49546edf8ac2286db4c5989f2c00c020c69ff7
tree82036a4a2f6ff2e464179f18eb2f892c1441406d
parent0b8be48baf5750ba2cb723deb037de44bbf4c385
Support "appending" read/write lock state that can be shared by readers
and writer. Writer promises not to update key metadata (except growing
object size and next pointers) and readers promise to be careful when
reading growing slices.

Support copying of partially cached entries from the shared memory cache to
local RAM. This is required for collapsed shared memory hits to receive new
data during broadcasted updates.

Properly unlock objects in the shared memory cache when their entries are
abandoned by a worker. This was not necessary before because we never locked
memory cache entries for more than a single method call. Now, with partially
cached entries support, the locks may persist much longer.

Properly delete objects from the shared memory cache when they are purged by a
worker. Before this change, locally purged objects may have stayed in the
shared memory cache.

Update disk cache index _after_ the changes are written to disk. Another
worker may be using that index and will expect to find the indexed slices on
disk. Disk queues are not FIFOs across workers.

Made CollapsedForwarding work better in non-SMP mode.

Polished broadcasting code. We need to broadcast entry key because the entry
may not have any other information (it may no longer be cached by the sender,
for example).

Implemented "anchoring" in-transit entries when the writer caches the
corresponding object. This allows the reader's entry object to reflect its
cached status and, hence, be able to ask for cached data during broadcasted
entry updates. Still need to handle the case where the writer does not cache
the object (by aborting collapsed hit).
21 files changed:
src/CollapsedForwarding.cc
src/CollapsedForwarding.h
src/MemObject.cc
src/MemObject.h
src/MemStore.cc
src/MemStore.h
src/Store.h
src/SwapDir.h
src/Transients.cc
src/fs/rock/RockIoRequests.cc
src/fs/rock/RockIoRequests.h
src/fs/rock/RockIoState.cc
src/fs/rock/RockIoState.h
src/fs/rock/RockSwapDir.cc
src/fs/rock/RockSwapDir.h
src/ipc/ReadWriteLock.cc
src/ipc/ReadWriteLock.h
src/ipc/StoreMap.cc
src/ipc/StoreMap.h
src/store.cc
src/store_dir.cc