Re: [PATCH 1/2] block: add blk_default_io_timeout() for avoiding task hung in sync IO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-04-28 18:17, Ming Lei wrote:
> On Tue, Apr 28, 2020 at 07:19:33AM -0700, Bart Van Assche wrote:
>> On 2020-04-28 00:46, Ming Lei wrote:
>>> +/*
>>> + * Used in sync IO for avoiding to triger task hung warning, which may
>>> + * cause system panic or reboot.
>>> + */
>>> +static inline unsigned long blk_default_io_timeout(void)
>>> +{
>>> +	return sysctl_hung_task_timeout_secs * (HZ / 2);
>>> +}
>>> +
>>>  #endif
>>
>> This function is only used inside the block layer. Has it been
>> considered to move this function from the public block layer API into a
>> private header file, e.g. block/blk.h?
> 
> Please look at the commit log or the 2nd patch, and the helper will be
> used in 2nd patch in dio code.

Has it been considered to use the expression
"sysctl_hung_task_timeout_secs * (HZ / 2)" directly instead of wrapping
that expression in a function? I think using the expression directly may
be more clear. Additionally, it is slightly confusing that the function
name starts with "blk_" but that nothing in the implementation of that
function is specific to the block layer.

Thanks,

Bart.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux