28.07.2013 Views

Performance Analysis and Optimization of the Hurricane File System ...

Performance Analysis and Optimization of the Hurricane File System ...

Performance Analysis and Optimization of the Hurricane File System ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3. HFS ARCHITECTURE 22<br />

directory contents, etc. The structure <strong>of</strong> <strong>the</strong> block cache system is shown in Figure 3.5. As stated by<br />

Krieger [34, p. 53], “Having multiple caches, each tuned for a different size, results in better performance<br />

than having a single physical cache with multiple element sizes”.<br />

In <strong>the</strong> original HFS design, <strong>the</strong> ORS cache contained 64 hash lists whereas <strong>the</strong> block cache contained<br />

only 4. The reasons for <strong>the</strong> difference have not been determined, however <strong>the</strong> size <strong>of</strong> <strong>the</strong> hash lists can be<br />

changed easily during <strong>the</strong> optimization process. The ORS cache contains a single dirty list whereas <strong>the</strong> block<br />

cache contains 8 dirty lists due to flushing order requirements <strong>of</strong> different types <strong>of</strong> meta-data.<br />

The free list in both <strong>the</strong> ORS <strong>and</strong> block cache indicates which items can be recycled although <strong>the</strong>y are<br />

given a second chance to be reused under <strong>the</strong>ir original identity should <strong>the</strong>y be needed. However, due to <strong>the</strong><br />

nature <strong>of</strong> <strong>the</strong> content in <strong>the</strong> two caches, <strong>the</strong> operation <strong>of</strong> <strong>the</strong> free list in <strong>the</strong> ORS cache is slightly different<br />

from <strong>the</strong> block cache. In <strong>the</strong> ORS cache, entries are placed on <strong>the</strong> free list only after <strong>the</strong> represented file<br />

is invalidated. In <strong>the</strong> block cache, entries are placed on <strong>the</strong> free list quite liberally. As long as <strong>the</strong> entry is<br />

not being used, meaning that it does not have a reader or writer lock set, <strong>and</strong> <strong>the</strong> contents are unaltered, it<br />

is placed onto <strong>the</strong> free list. Consequently, <strong>the</strong> free list is utilized much more frequently in <strong>the</strong> block cache.<br />

In <strong>the</strong> ORS cache, <strong>the</strong> entries cannot be on <strong>the</strong> free list <strong>and</strong> <strong>the</strong> hash list simultaneously <strong>and</strong> hence <strong>the</strong><br />

free list exists as a separate list. In <strong>the</strong> block cache, entries can exist on both <strong>the</strong> free list <strong>and</strong> a hash list<br />

simultaneously <strong>and</strong> hence <strong>the</strong> free list is threaded throughout <strong>the</strong> cache. This policy in <strong>the</strong> block cache leads<br />

to a natural recycling process <strong>of</strong> cache entries.<br />

The locking infrastructure is different as well. In <strong>the</strong> block cache, <strong>the</strong>re is a single global lock protecting<br />

all data structures. On <strong>the</strong> o<strong>the</strong>r h<strong>and</strong>, <strong>the</strong> ORS cache uses a number <strong>of</strong> locks, each protecting a specific<br />

group <strong>of</strong> data structures. For instance, <strong>the</strong>re is a lock for each hash list header, for <strong>the</strong> dirty list header, <strong>and</strong><br />

free list header. The difference in locking infrastructure is due to <strong>the</strong> nature <strong>of</strong> access <strong>and</strong> purpose <strong>of</strong> <strong>the</strong><br />

two different meta-data caches. The ORS cache contains file attributes that must be consulted (<strong>and</strong> possibly<br />

modified) frequently. Access latency is very important, which may be <strong>the</strong> reason for <strong>the</strong> finer-grain locks.<br />

On <strong>the</strong> o<strong>the</strong>r h<strong>and</strong>, access latency to <strong>the</strong> block cache contents may not be as critical so <strong>the</strong> simpler design<br />

<strong>of</strong> a single global lock may be sufficient.<br />

There are trade-<strong>of</strong>fs between <strong>the</strong> two designs. Under a single global locking scheme, <strong>the</strong> number <strong>of</strong> locks<br />

that need to be acquired for any operation on <strong>the</strong> target data structures is small, whereas under a finer grain<br />

locking scheme, several locks need to be acquired for an operation. The disadvantage <strong>of</strong> <strong>the</strong> global locking<br />

scheme is that it may lead to high contention on <strong>the</strong> single lock if <strong>the</strong> lock is held for long periods <strong>of</strong> time<br />

<strong>and</strong> <strong>the</strong>re are many concurrent threads that are competing for <strong>the</strong> single global lock. Finer grain locks can<br />

reduce this contention but at <strong>the</strong> cost <strong>of</strong> higher overhead.<br />

Meta-data cache flushing policies have not been decided <strong>and</strong> may have a significant impact on perfor-<br />

mance. For our experiments, cache flushing is triggered explicitly when desired.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!