From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C43822619; Tue, 28 Jan 2025 19:32:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738092723; cv=none; b=t1j0ZM2BeEMznhY7OuU8HzO+5/AcDvBYxQi9VJmumPQArqPWWPjguTLdfjrLbuGKDpri/8PlPS2FxzJVKXBdqcKSxjFxYCfVZMth72420vbZBf9j4SDb4nkm42zuNhkmWKukrjpLX74YKO+TnGUKEBzfj5FshovVaL7fLwt6oKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738092723; c=relaxed/simple; bh=owNZ34z8H8gKLRBDKBwfWe18qn3L1v88nfMIg3Pz1LA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F+1mbOu409DkUkwa54WvMV2nnJ3DWqeV1Kb2eUZR8tcELqKjgR68KAjSbAoZ9guTAUxpRAyK8W4U6sKdhkparHld2MMCPX4l/m+UyS6oop2Py02723cqUHhzngsyYFOIFYsJnbCleALlpNvRXZUl2SoZyWTUkpv9ooiCj5IxJaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SRwyMrI+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SRwyMrI+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5F73C4CED3; Tue, 28 Jan 2025 19:32:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738092722; bh=owNZ34z8H8gKLRBDKBwfWe18qn3L1v88nfMIg3Pz1LA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SRwyMrI+7rEDcHW7IuHVGV+Beu/rz3fr4xRZE/2FNaxy/8w04xmtMB+5l/7OjtE7X g/ih+kr8TPIvY/SUMmDSRxJ9agHUzYETwZBr5Vr1MKa3PL3qv7X/YMDfOsOf9s2Vo5 w0pVGeJ25CkC8SD9eHiydelX+MwSAm4rpeoVmHUek+yQ4hSnEZyQONnAeLKb6DUyIW UK07D+tXIeIjeZTqlhU59S2JZeZJV301qEk91VI6n4APgSoo/WoePKctqgMT4vkHwk x3yl5NU9mWz8XPDeJzaWsXZh8d3H0HM6TZ2FVo8Y+2ItMnE82HdktnkogYjBpDnvic uPKV+NxOKmHOw== Date: Tue, 28 Jan 2025 11:32:02 -0800 From: "Darrick J. Wong" To: Easwar Hariharan Cc: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky , cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org Subject: Re: [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies() Message-ID: <20250128193202.GR1611770@frogsfrogsfrogs> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> <20250128-converge-secs-to-jiffies-part-two-v1-9-9a6ecf0b2308@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-9-9a6ecf0b2308@linux.microsoft.com> On Tue, Jan 28, 2025 at 06:21:54PM +0000, Easwar Hariharan wrote: > 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 \) > ) > > Signed-off-by: Easwar Hariharan Looks good to me, Acked-by: "Darrick J. Wong" --D > --- > fs/xfs/xfs_icache.c | 2 +- > fs/xfs/xfs_sysfs.c | 7 +++---- > 2 files changed, 4 insertions(+), 5 deletions(-) > > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c > index 7b6c026d01a1fc020a41a678964cdbf7a8113323..7a1feb8dc21f6f71d04f88de866e5a95925e0c54 100644 > --- a/fs/xfs/xfs_icache.c > +++ b/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(); > } > > diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c > index 60cb5318fdae3cc246236fd988b4749df57f8bfc..eed0f28afe97ead762a9539e45f292db7d0d0c4a 100644 > --- a/fs/xfs/xfs_sysfs.c > +++ b/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,7 @@ 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; > > > -- > 2.43.0 > >