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 check before tpps_del_queue()

We found panic on BUG_ON(tppg->nr_tppq < 1) in pressure-testing.
After long term (about one month) tracing we finally find out the reason: some scsi_cmds
passed from scsi_ioctl will call blk_execute_rq_nowait and call tpps_set_request() but
never call tpps_insert_request() (It even doesn't get into io-scheduler) so the counter
of nr_tppq gets wrong.
To fix it, we add check before calling tpps_del_queue() and for making it safer, adding
check before BUG_ON() to report more information.

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