1. A method, comprising: receiving, by a controller, a request to perform a release space operation; determining that a new discard scan has to be performed on a cache, in response to the received request to perform the release space operation; and determining how many task control blocks are to be allocated to perform the new discard scan, based on how many task control blocks have already been allocated for performing one or more discard scans that are already in progress, the operations further comprising: determining, whether input/output (I/O) operations on the cache that cannot be performed exceed a threshold number of I/O operations, wherein the I/O operations cannot be performed because of discard scans that are already in progress; and in response to determining that the I/O operations on the cache that cannot be performed exceed the threshold number of I/O operations, allocating an increased number of task control blocks for each new discard scan if additional task control blocks are available.