aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-09-11 12:59:53 -0400
committerJens Axboe <axboe@kernel.dk>2018-09-11 12:59:53 -0400
commit01c5f85aebaaddfd7e6051fb2ec80c1d4b463554 (patch)
tree1bec8d2fd88742a5396eb359a087c59dfa8fa08e /block/blk-cgroup.c
parentbf93585ee1e25461426c61e5ff64a3acd9e30e88 (diff)
blk-cgroup: increase number of supported policies
After merging the iolatency policy, we potentially now have 4 policies being registered, but only support 3. This causes one of them to fail loading. Takashi reports that BFQ no longer works for him, because it fails to load due to policy registration failure. Bump to 5 policies, and also add a warning for when we have exceeded the global amount. If we have to touch this again, we should switch to a dynamic scheme instead. Reported-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Tested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index c19f9078da1e..c630e02836a8 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1510,8 +1510,10 @@ int blkcg_policy_register(struct blkcg_policy *pol)
1510 for (i = 0; i < BLKCG_MAX_POLS; i++) 1510 for (i = 0; i < BLKCG_MAX_POLS; i++)
1511 if (!blkcg_policy[i]) 1511 if (!blkcg_policy[i])
1512 break; 1512 break;
1513 if (i >= BLKCG_MAX_POLS) 1513 if (i >= BLKCG_MAX_POLS) {
1514 pr_warn("blkcg_policy_register: BLKCG_MAX_POLS too small\n");
1514 goto err_unlock; 1515 goto err_unlock;
1516 }
1515 1517
1516 /* Make sure cpd/pd_alloc_fn and cpd/pd_free_fn in pairs */ 1518 /* Make sure cpd/pd_alloc_fn and cpd/pd_free_fn in pairs */
1517 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) || 1519 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) ||