On 3/17/20 9:43 PM, Ming Lei wrote: > submit_bio_wait() can be called from ioctl(BLKSECDISCARD), which > may take long time to complete, as Salman mentioned, 4K BLKSECDISCARD > takes up to 100 second on some devices. Also any block I/O operation > that occurs after the BLKSECDISCARD is submitted will also potentially > be affected by the hung task timeouts. > > Another report is that task hang can be observed when running mkfs > over raid10 which takes a small max discard sectors limit because > of chunk size. > > So prevent hung_check from firing by taking same approach used > in blk_execute_rq(), and the wake-up interval is set as half the > hung_check timer period, which keeps overhead low enough. Applied, thanks. We have two of these similar constructs now in block alone, I wonder if there are others in other sub-systems. Might make sense to make this a generic helper at some point. -- Jens Axboe