Fix flashcache reboot notify hook to drop references on the cachedev and diskdev after syncing
everything out.

Summary: Fix flashcache reboot notify hook to drop references on the cachedev and diskdev
after syncing  everything out. Fix ported from facebook internal repo. Fix was originally
submitted by Kumar Sundararajan.

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev:
Fix in del_all_pids, to the existence of a pid logic.

Summary: We had commented out the code in the del_all_pids logic
where we checked to see if the pid we are deleting is currently
alive in all releases > 2.6.31. This is because the find_task_pid*
API wasn't EXPORT_SYMBOL'ed in .33. It is in .38. So resurrecting
this back for Linux releases >= 2.6.38.
Fix brought in from facebook internal flashcache repo (kinda
important for MySQL).

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev:
Lots of flashcache IO scaling changes.

Summary:

This commit has a number of flashcache changes aimed at improving
IO scaling.
1) Uniform distribution of blocks onto cache sets (instead of the
linear mapping before). But pin a consecutive run of disk blocks
onto a cache set (for clustering when writing). This necessitates
a flashcache ssd rev bump (2->3). Backwards compatiblity is maintained.
2) New heuristic algorithm to clean dirty+fallow blocks. When we
replace a block (read or write cache miss), we opportunistically look
to see if the least recent block on LRU is dirty and if so we clean it.
This makes more room in the cache for reads.
3) New LRU algorithm - a variant of the midpoint algorithm, using
2 LRU Queues.
Thanks to Kumar for co-authorship of some of these changes and Domas
for driving this round of flashcache scaling work.

Ported forward from facebook's internal repo.

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev:
Make each in-memory cacheblock state packed - 18 bytes each.

Summary: Make 'struct cacheblock' a packed struct. So it fits in
18 bytes (down from 24 bytes).

Ported forward from facebook's internal repo.

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev:
Flashcache ulocks changes.

Summary:

Sweeping ulocks changes to flashcache.

Ported forward from the facebook internal repo.

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev:
Block hashing, fast allocation of invalid blocks, important fixes.

Summary:
1) Hash all VALID blocks in a set for fast lookups and invalidations.
2) Fast allocation of INVALID blocks.
3) Critical fixes - fix for a softlockup (kworker doing flashcache
   processing), page allocation failures in the background cleaning
   path by pre-allocation of background buffers, serious bug that
   causes data corruption on a flashcache_load because the disk_assoc
   was initialized wrongly.

Ported to open source from internal facebook repo.

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev: