The patch titled Subject: xfs: convert timeouts to secs_to_jiffies() has been added to the -mm mm-nonmm-unstable branch. Its filename is xfs-convert-timeouts-to-secs_to_jiffies.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/xfs-convert-timeouts-to-secs_to_jiffies.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Easwar Hariharan <eahariha@xxxxxxxxxxxxxxxxxxx> Subject: xfs: convert timeouts to secs_to_jiffies() Date: Tue, 25 Feb 2025 20:17:23 +0000 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies() to avoid the multiplication This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Link: https://lkml.kernel.org/r/20250225-converge-secs-to-jiffies-part-two-v3-9-a43967e36c88@xxxxxxxxxxxxxxxxxxx Signed-off-by: Easwar Hariharan <eahariha@xxxxxxxxxxxxxxxxxxx> Acked-by: Darrick J. Wong <djwong@xxxxxxxxxx> Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx> Cc: Carlos Maiolino <cem@xxxxxxxxxx> Cc: Chris Mason <clm@xxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Damien Le Maol <dlemoal@xxxxxxxxxx> Cc: David Sterba <dsterba@xxxxxxxx> Cc: Dick Kennedy <dick.kennedy@xxxxxxxxxxxx> Cc: Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx> Cc: Fabio Estevam <festevam@xxxxxxxxx> Cc: Frank Li <frank.li@xxxxxxx> Cc: Hans de Goede <hdegoede@xxxxxxxxxx> Cc: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx> Cc: Ilpo Jarvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx> Cc: Ilya Dryomov <idryomov@xxxxxxxxx> Cc: James Bottomley <james.bottomley@xxxxxxxxxxxxxxxxxxxxx> Cc: James Smart <james.smart@xxxxxxxxxxxx> Cc: Jaroslav Kysela <perex@xxxxxxxx> Cc: Jason Gunthorpe <jgg@xxxxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Cc: Josef Bacik <josef@xxxxxxxxxxxxxx> Cc: Julia Lawall <julia.lawall@xxxxxxxx> Cc: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@xxxxxxxxxxxx> Cc: Keith Busch <kbusch@xxxxxxxxxx> Cc: Leon Romanovsky <leon@xxxxxxxxxx> Cc: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> Cc: Mark Brown <broonie@xxxxxxxxxx> Cc: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx> Cc: Nicolas Palix <nicolas.palix@xxxxxxx> Cc: Niklas Cassel <cassel@xxxxxxxxxx> Cc: Oded Gabbay <ogabbay@xxxxxxxxxx> Cc: Sagi Grimberg <sagi@xxxxxxxxxxx> Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> Cc: Sebastian Reichel <sre@xxxxxxxxxx> Cc: Selvin Thyparampil Xavier <selvin.xavier@xxxxxxxxxxxx> Cc: Shawn Guo <shawnguo@xxxxxxxxxx> Cc: Shyam-sundar S-k <Shyam-sundar.S-k@xxxxxxx> Cc: Takashi Iwai <tiwai@xxxxxxxx> Cc: Takashi Iwai <tiwai@xxxxxxx> Cc: Xiubo Li <xiubli@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/xfs/xfs_icache.c | 2 +- fs/xfs/xfs_sysfs.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) --- a/fs/xfs/xfs_icache.c~xfs-convert-timeouts-to-secs_to_jiffies +++ a/fs/xfs/xfs_icache.c @@ -230,7 +230,7 @@ xfs_blockgc_queue( rcu_read_lock(); if (radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_BLOCKGC_TAG)) queue_delayed_work(mp->m_blockgc_wq, &pag->pag_blockgc_work, - msecs_to_jiffies(xfs_blockgc_secs * 1000)); + secs_to_jiffies(xfs_blockgc_secs)); rcu_read_unlock(); } --- a/fs/xfs/xfs_sysfs.c~xfs-convert-timeouts-to-secs_to_jiffies +++ a/fs/xfs/xfs_sysfs.c @@ -568,8 +568,8 @@ retry_timeout_seconds_store( if (val == -1) cfg->retry_timeout = XFS_ERR_RETRY_FOREVER; else { - cfg->retry_timeout = msecs_to_jiffies(val * MSEC_PER_SEC); - ASSERT(msecs_to_jiffies(val * MSEC_PER_SEC) < LONG_MAX); + cfg->retry_timeout = secs_to_jiffies(val); + ASSERT(secs_to_jiffies(val) < LONG_MAX); } return count; } @@ -686,8 +686,8 @@ xfs_error_sysfs_init_class( if (init[i].retry_timeout == XFS_ERR_RETRY_FOREVER) cfg->retry_timeout = XFS_ERR_RETRY_FOREVER; else - cfg->retry_timeout = msecs_to_jiffies( - init[i].retry_timeout * MSEC_PER_SEC); + cfg->retry_timeout = + secs_to_jiffies(init[i].retry_timeout); } return 0; _ Patches currently in -mm which might be from eahariha@xxxxxxxxxxxxxxxxxxx are coccinelle-misc-secs_to_jiffies-patch-expressions-too.patch scsi-lpfc-convert-timeouts-to-secs_to_jiffies.patch accel-habanalabs-convert-timeouts-to-secs_to_jiffies.patch alsa-ac97-convert-timeouts-to-secs_to_jiffies.patch btrfs-convert-timeouts-to-secs_to_jiffies.patch libceph-convert-timeouts-to-secs_to_jiffies.patch ata-libata-zpodd-convert-timeouts-to-secs_to_jiffies.patch xfs-convert-timeouts-to-secs_to_jiffies.patch power-supply-da9030-convert-timeouts-to-secs_to_jiffies.patch nvme-convert-timeouts-to-secs_to_jiffies.patch spi-spi-fsl-lpspi-convert-timeouts-to-secs_to_jiffies.patch spi-spi-imx-convert-timeouts-to-secs_to_jiffies.patch platform-x86-amd-pmf-convert-timeouts-to-secs_to_jiffies.patch platform-x86-thinkpad_acpi-convert-timeouts-to-secs_to_jiffies.patch rdma-bnxt_re-convert-timeouts-to-secs_to_jiffies.patch