public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Easwar Hariharan <eahariha@linux.microsoft.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
	 Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,  Dexuan Cui <decui@microsoft.com>,
	linux-hyperv@vger.kernel.org,
	 Anna-Maria Behnsen <anna-maria@linutronix.de>,
	 Thomas Gleixner <tglx@linutronix.de>,
	 Geert Uytterhoeven <geert@linux-m68k.org>,
	 Marcel Holtmann <marcel@holtmann.org>,
	 Johan Hedberg <johan.hedberg@gmail.com>,
	 Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	 linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Praveen Kumar <kumarpraveen@linux.microsoft.com>,
	 Naman Jain <namjain@linux.microsoft.com>
Cc: Michael Kelley <mhklinux@outlook.com>,
	 Easwar Hariharan <eahariha@linux.microsoft.com>,
	 Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Subject: [PATCH v3 0/2] Converge on secs_to_jiffies()
Date: Wed, 30 Oct 2024 17:47:34 +0000	[thread overview]
Message-ID: <20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com> (raw)

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.

Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
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/20241022185353.2080021-1-eahariha@linux.microsoft.com/
- Move secs_to_jiffies in include/linux/jiffies.h
- Use secs_to_jiffies in drivers/hv
RFC: https://lore.kernel.org/all/20241016223730.531861-1-eahariha@linux.microsoft.com/
- 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,
-- 
Easwar Hariharan <eahariha@linux.microsoft.com>


             reply	other threads:[~2024-10-30 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 17:47 Easwar Hariharan [this message]
2024-10-30 17:47 ` [PATCH v3 1/2] jiffies: Define secs_to_jiffies() Easwar Hariharan
2024-10-30 18:52   ` [tip: timers/core] " tip-bot2 for Easwar Hariharan
2024-10-31 15:54   ` [PATCH v3 1/2] " Haiyang Zhang
2024-10-31 17:05     ` Easwar Hariharan
2024-10-31 17:28       ` Haiyang Zhang
2024-10-30 17:47 ` [PATCH v3 2/2] drivers: hv: Convert open-coded timeouts to secs_to_jiffies() Easwar Hariharan
2024-10-31  2:03   ` Michael Kelley
2024-12-07  7:52   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com \
    --to=eahariha@linux.microsoft.com \
    --cc=anna-maria@linutronix.de \
    --cc=decui@microsoft.com \
    --cc=geert@linux-m68k.org \
    --cc=haiyangz@microsoft.com \
    --cc=johan.hedberg@gmail.com \
    --cc=kumarpraveen@linux.microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=mhklinux@outlook.com \
    --cc=namjain@linux.microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox