[LU-12931] Fix minor errors with cfs_time_seconds usage Created: 04/Nov/19  Updated: 19/Oct/20  Resolved: 30/Jan/20

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.11.0, Lustre 2.12.0, Lustre 2.13.0
Fix Version/s: Lustre 2.14.0

Type: Improvement Priority: Critical
Reporter: Neil Brown Assignee: Neil Brown
Resolution: Fixed Votes: 0
Labels: LTS12

Issue Links:
Related
is related to LU-9019 Migrate lustre to standard 64 bit tim... Resolved
Rank (Obsolete): 9223372036854775807

 Description   

cfs_time_seconds() converts seconds to jiffies.

Unfortunately the name might suggest it returns seconds, rather than consumes them, so it is worth while doing an occasion audit to make sure it isn't being misused.

At time of writing there is one place (in delayed_msg_check) where it is used but not needed (we have seconds and want seconds), and two places (ptl_recover_import and mgc_process_log) where the returned value is stored in a variable called "sec".  The variable is used correctly as jiffies, but the name is confusing.

These irregularities should be fixed.



 Comments   
Comment by Gerrit Updater [ 04/Nov/19 ]

Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/36658
Subject: LU-12931 general: fix some cfs_time_seconds() inconsistencies.
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 4522b507bed9b53329afbb387dc0318512f4deb3

Comment by Gerrit Updater [ 04/Nov/19 ]

Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/36668
Subject: LU-12931 general: fix some cfs_time_seconds() inconsistencies.
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 09fc491dafd95596493ce50ebaefc6e9da95498a

Comment by Gerrit Updater [ 06/Nov/19 ]

James Simmons (jsimmons@infradead.org) uploaded a new patch: https://review.whamcloud.com/36688
Subject: LU-12931 timers: correctly offset mod_timer.
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b2342bd0f3ce8bf388626cef3735b60e573de55d

Comment by Gerrit Updater [ 07/Nov/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36701
Subject: LU-12931 misc: correctly use jiffies for mod_timer
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 4710fc32b245bb6a0ba8ec5056eb724c087cf1c2

Comment by Gerrit Updater [ 07/Nov/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36702
Subject: LU-12931 misc: use jiffies for schedule_timeout()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fd8a19e7ff56e63db6bf00e6c31004ee7781def8

Comment by Andreas Dilger [ 07/Nov/19 ]

Note - only one of the patches 36702/36701/36688 needs to be landed. The 36658 patch is fixing an unrelated (cosmetic) issue.

Comment by Gerrit Updater [ 06/Dec/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36668/
Subject: LU-12931 general: fix some cfs_time_seconds() inconsistencies.
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 451a2634a967a4784340ba1c47182e0bdb4d56e1

Comment by Gerrit Updater [ 14/Dec/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36688/
Subject: LU-12931 timers: correctly offset mod_timer.
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: e150810faa5b22382b2213225478c3763195438b

Comment by James A Simmons [ 30/Jan/20 ]

Seems all patches landed. If more are needed we can reopen.

Comment by Gerrit Updater [ 01/Mar/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36702/
Subject: LU-12931 gnilnd: use time_after() to compare jiffies
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: bd1808a3a250003d865a6b0624bad2b5204bbd12

Comment by Gerrit Updater [ 25/Apr/20 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/38365
Subject: LU-12931 ldlm: use proper units for timeouts
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1ec25e295d0c8028eeb49f5951f03b95693912c5

Comment by Gerrit Updater [ 20/May/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38365/
Subject: LU-12931 ldlm: use proper units for timeouts
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3108bbb0b8485484bc1ac8ba5bac4276fc11c7c3

Comment by Gerrit Updater [ 06/Oct/20 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/40145
Subject: LU-12931 libcfs: skip cfs_time_seconds() indirection
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e3f8313165de044e793b280b6722b1fce8abe713

Comment by Gerrit Updater [ 19/Oct/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40145/
Subject: LU-12931 libcfs: skip cfs_time_seconds() indirection
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: faeeda3a69689f48605561f9e86e5a59b7d6b1fc

Generated at Sat Feb 10 02:56:54 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.