flashcache: fix scheduler switch panic bug

After applied "multi request list" patches for flashcache, when calling blk_get_rl and the
scheduler is switching right now, it will get a 'dead' request-list, so we add condition
to fetch root_rl when io-scheduler is switching.

Signed-off-by: Robin Dong <sanbai@taobao.com>
tpps: add new io-scheduler 'tpps' mainly from cfq code

We want to use blkio.cgroup on high-speed device (like fusionio) for our mysql clusters.
After testing different io-scheduler, we found that  cfq is too slow and deadline can't run on cgroup.
So we developed a new io-scheduler: tpps (Tiny Parallel Proportion Scheduler).It dispatch requests
only by using their individual weight and total weight (proportion) therefore it's simply and efficient.

The main code framework of tpps is from cfq.

Test case: fusionio card, 4 cgroups, iodepth-512

groupname  weight
test1      1000
test2      800
test3      600
test4      400

Use tpps, the result is:

groupname  iops    avg-rt(ms)   max-rt(ms)
test1      30220   16           54
test2      28261   18           56
test3      26333   19           69
test4      20152   25           87

Use cfq, the result is:

groupname  iops    avg-rt(ms)   max-rt(ms)
test1      16478   30           242
test2      13015   39           347
test3       9300   54           371
test4       5806   87           393

Signed-off-by: Robin Dong <sanbai@taobao.com>
tpps: add new func tpps_forced_dispatch()

Add new func tpps_forced_dispatch() to dispatch all requests forcely.
Without this dmesg will report warning.

Signed-off-by: Robin Dong <sanbai@taobao.com>
tpps: update weight of group timely

Update the group's weight before compute quota of a group in tpps_dispatch_request()
for dispatching precisely.

Signed-off-by: Robin Dong <sanbai@taobao.com>
tpps: add new blkio_policy_type for tpps

Add new blkio_policy_type with plid equaling to "BLKIO_POLICY_TPPS" so
the blkcg_get_weight could get right 'weight' value.

Signed-off-by: Robin Dong <sanbai@taobao.com>
tpps: add new members in struct io_context for new scheduler

Add new radix_tree and tic_data in struct io_context for tpps to avoid
conflict between cfq and tpps when useing context structure of io.

Signed-off-by: Robin Dong <sanbai@taobao.com>
tpps: add checks for tppg->nr_tppq in tpps_del_queue()

In offline mysql press testing, some requests may go into tpps_add_request() but
not tpps_insert_request() and makes nr_tppq incorrectly when switching to cfq.
To avoid this, add check in tpps_del_queue() to avoid panic in switching.

Signed-off-by: Robin Dong <sanbai@taobao.com>