Thread (52 messages) 52 messages, 14 authors, 2024-12-09

Re: [PATCH v2 00/21] Converge on using secs_to_jiffies()

From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Date: 2024-12-09 12:02:04
Also in: ath11k, ceph-devel, dri-devel, intel-xe, linux-arm-kernel, linux-block, linux-bluetooth, linux-mm, linux-s390, linux-scsi, linux-sound, linux-staging, linux-wireless, live-patching, lkml, netdev, netfilter-devel, xen-devel

On 12/6/24 9:58 PM, Easwar Hariharan wrote:
On 11/29/2024 4:57 AM, Przemek Kitszel wrote:
quoted
[removed most non-list recipients, it's just too much]

On 11/15/24 10:26 PM, Easwar Hariharan wrote:
<snip>
quoted
Regarding code - you could also convert msecs_to_jiffies(const * HZ),
there are 10 that are greppable.
Those seem to be mistakes. const*HZ is a seconds-denominated timeout,
being passed to msecs_to_jiffies() which will treat it as a
millisecond-denominated timeout resulting in an excessively long
timeout. I suppose that's better than a too-short timeout, and
apparently it's been working fine all along since hardware responds
before the too-long timeout expires. Half of them are in
drivers/scsi/arcmsr/arcmsr_hba.c and the pattern has apparently been
there since 2010.
my point was that, the default value of HZ is 1000, and most of the code
that is just `$value*HZ` was meant as "$value seconds, in ms unit".

Same for HZ/const, HZ/2 being 500ms.

HZ is awful in that it is not 1s but 1/s, but it was easy to abuse the
value in simple context.

If you happen to touch this, please do in a separate series, to get more
attention from drivers owners.
Thanks,
Easwar
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help