Skip to content

Converge on secs_to_jiffies()

Easwar Hariharan linux-bluetooth linux-hyperv lkml 3 versions – Applied

Status from this message: The following commit has been merged into the timers/core branch of tip:

Get series with b4
b4 am 20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com change-id 20241028-open-coded-timeouts-6dc7cbb6572d

Versions newest first

  1. v3 Latest2 patches 5 repliesApplied
  2. v22 patches 7 repliesSuperseded inferred link
  3. v12 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- Pickup Reviewed-by tag from Luiz Augusto von Dentz
- Add kernel doc comment for secs_to_jiffies() (tglx)
- secs_to_jiffies() is defined as a macro rather than a static inline
function due to its potential usage in struct initializers, where it
wouldn't work per Geert (documentation in changelog requested per tglx)
v2: https://lore.kernel.org/r/20241028-open-coded-timeouts-v2-0-c7294bb845a1@linux.microsoft.com
- Add a cover letter
- Define secs_to_jiffies(s) as (s * HZ) instead of msecs_to_jiffies(s * MSEC_PER_SEC) (Anna-Maria)
v1: https://lore.kernel.org/all/[email protected]/
- Move secs_to_jiffies in include/linux/jiffies.h
- Use secs_to_jiffies in drivers/hv
RFC: https://lore.kernel.org/all/[email protected]/
- Convert open coded timeouts (secs * HZ) in drivers/hv to msecs_to_jiffies()

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2jiffies: Define secs_to_jiffies()include/linux/jiffies.h net/bluetooth/hci_event.c+12 -23 replies
2/2drivers: hv: Convert open-coded timeouts to secs_to_jiffies()drivers/hv/hv_balloon.c drivers/hv/hv_kvp.c drivers/hv/hv_snapshot.c +1 more+10 -82 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchLuiz Augusto von DentzMichael Kelley
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] Converge on secs_to_jiffies()

There are ~1150 call sites for msecs_to_jiffies() that:
- Use a multiplier of 1000, or MSEC_PER_SEC, or
- have timeouts that are denominated in seconds, i.e. end in 000

There are yet more sites that use (secs * HZ). Provide secs_to_jiffies() as a new member of the *_to_jiffies() family and convert a few instances as a first user.

---
changelog:
v3:
- Pickup Reviewed-by tag from Luiz Augusto von Dentz
- Add kernel doc comment for secs_to_jiffies() (tglx)
- secs_to_jiffies() is defined as a macro rather than a static inline
function due to its potential usage in struct initializers, where it
wouldn't work per Geert (documentation in changelog requested per tglx)
v2: https://lore.kernel.org/r/20241028-open-coded-timeouts-v2-0-c7294bb845a1@linux.microsoft.com
- Add a cover letter
- Define secs_to_jiffies(s) as (s * HZ) instead of msecs_to_jiffies(s * MSEC_PER_SEC) (Anna-Maria)
v1: https://lore.kernel.org/all/[email protected]/
- Move secs_to_jiffies in include/linux/jiffies.h
- Use secs_to_jiffies in drivers/hv
RFC: https://lore.kernel.org/all/[email protected]/
- Convert open coded timeouts (secs * HZ) in drivers/hv to msecs_to_jiffies()

---
Easwar Hariharan (2):
jiffies: Define secs_to_jiffies()
drivers: hv: Convert open-coded timeouts to secs_to_jiffies()

 drivers/hv/hv_balloon.c   |  9 +++++----
 drivers/hv/hv_kvp.c       |  4 ++--
 drivers/hv/hv_snapshot.c  |  3 ++-
 drivers/hv/vmbus_drv.c    |  2 +-
 include/linux/jiffies.h   | 12 ++++++++++++
 net/bluetooth/hci_event.c |  2 --
 6 files changed, 22 insertions(+), 10 deletions(-)

---
base-commit: 81983758430957d9a5cb3333fe324fd70cf63e7e
change-id: 20241028-open-coded-timeouts-6dc7cbb6572d

Best regards,

Signature · 1 line
Easwar Hariharan <[email protected]>