Received: by 10.213.65.68 with SMTP id h4csp2849481imn; Mon, 2 Apr 2018 15:28:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx48M4LheoR+v4IBkcm5sxic4huMaKPDog4za7W4ks4BrhNllY/aq31GLCNz+U2E+L78cWtcx X-Received: by 10.98.70.8 with SMTP id t8mr8633490pfa.185.1522708083534; Mon, 02 Apr 2018 15:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522708083; cv=none; d=google.com; s=arc-20160816; b=WCg42bKRUSJtW/TiReXDunCzlhYaufWBtIkVn5ICIdImoN3CuKtyvzrG8liCUWLyMu r9ko2RQzt54QT/QDsGu6hrGQSqroKVI3FUqRRDKgUe4hJ0BW3suj18QzzDBwNt/KFR74 oHsZgOm9uRgJELvoFyBpH+t2yZMekMjHoAQJgwf40OE84En2SJ8yfBo+6S6AniPg7fu5 SJojJEM1aAeFyiKHTld4eqLjNceSXOxAxFpgK/Cmp28sL/zIhyio7jOriZUUqOX1rWx5 2tiUL/ZP6POD6jhkdahqSdvlBEposJtyeIoJpvS0CeqU/FRsxPfcPmfIWbBl47RNMLbh KWrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:references :in-reply-to:subject:cc:date:to:from:arc-authentication-results; bh=QozKXIA+KXio9wFE0imNfH6m8chywA3GytichCk+8tY=; b=IA8eRmzcKoPMdR2XbRx1GS5NcHSzj2OmBB+boMBrQ2Uz0mrGOeeEps2OTIe9+kpzJB rvoqpNYve1pRkz0UsmF1XkjhREDNoQ+NH2wqCFS7Vq+witjKLvUNmDFUpSrWbnFOuSMG Iw+oeFV45w46KSUDZHPID5wE3/tIg3cYks/egR2N+b/E/OugJmoa26B2j0vGrSFWLbr9 pUNzkcoUkiYlXtVYb8WE/1n0YosJ8EZ4j+wZviwzsRGG1KSnr5E9+uakoVW5ZuFmRORi 0sZBelmxg6vZ/s69jl+0+PbOey4XSsCI/DhwXhPk9ac/ChFc2YiGHsD+WyydHubQsJNi Ar2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c76si855202pga.156.2018.04.02.15.27.49; Mon, 02 Apr 2018 15:28:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754568AbeDBW03 (ORCPT + 99 others); Mon, 2 Apr 2018 18:26:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:59598 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754492AbeDBW02 (ORCPT ); Mon, 2 Apr 2018 18:26:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2B2A7AE46; Mon, 2 Apr 2018 22:26:27 +0000 (UTC) From: NeilBrown To: "Dilger\, Andreas" , James Simmons Date: Tue, 03 Apr 2018 08:26:15 +1000 Cc: "Drokin\, Oleg" , "Greg Kroah-Hartman" , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 11/17] staging: lustre: libcfs: discard cfs_time_shift(). In-Reply-To: <0B6A147C-7E98-4B00-AF32-AF8843484CF9@intel.com> References: <152229732768.27689.4800156943561963977.stgit@noble> <152229760863.27689.4681198496926109808.stgit@noble> <0B6A147C-7E98-4B00-AF32-AF8843484CF9@intel.com> Message-ID: <87muyl1bzs.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, Apr 02 2018, Dilger, Andreas wrote: >> On Mar 30, 2018, at 13:02, James Simmons wrote: >>=20 >>=20 >>> This function simply multiplies by HZ and adds jiffies. >>> This is simple enough to be opencoded, and doing so >>> makes the code easier to read. >>>=20 >>> Same for cfs_time_shift_64() >>=20 >> Reviewed-by: James Simmons > > Hmm, I thought we were trying to get rid of direct HZ usage in modules, > because of tickless systems, and move to e.g. msecs_to_jiffies() or simil= ar? Are we? I hadn't heard but I could easily have missed it. Documentation/scheduler/completion.txt does say Timeouts are preferably calculated with msecs_to_jiffies() or usecs_to_jiffies(). but is isn't clear what they are preferred to. Do you remember where you heard? or have a reference? $ git grep ' \* *HZ' |wc 2244 15679 170016 $ git grep msecs_to_jiffies | wc 3301 13151 276725 so msecs_to_jiffies is slightly more popular than "* HZ" (even if you add in "HZ *"). But that could just be a preference for using milliseconds over using seconds. $ git grep msecs_to_jiffies | grep -c '[0-9]000' 587 so there are only 587 places that msecs_to_jiffies is clearly used in place of multiplying by HZ. If we were to pursue this, I would want to add secs_to_jiffies() to include/linux/jiffies.h and use that. Thanks, NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlrCrggACgkQOeye3VZi gblbAQ//V+WKLCq3hb0nBpkm0IoqhnUaa4HVgZO9UsYdmv7gQm42v8GlIK41OxeH NCdIwR4mWeTxGVnLPb1gxECHivFZeYQRrxoUJGDTiKN4CstKl3EMOD6jvSCAFPaX 2Z407pP5U+n6yJ55W4wKJWXJKrLF0V7hzOht6zMr3ON6hSbpiJYWo55LRcT9uJtR TZfm7hSk2cgpRDOcN4Wh4Bjer71PGs/prbKA67EM7ubc83O6mXcs3qLfMAY5fRCl rGA76CkScmLJj04xgGM6MsQeiQa77fdkWzzk959Jb2ZpbBPpKbDkFWX3FFlns6nz w7oVp2CZWJqZsPp4xRJLcjXIRrDqiqBUUM+QObJ63y8yxo7esn0bwTHJrajc8WtA 1S1vrCEmIxTKq+vphi2L6Te2QpQphfyg2pcrDsI37yRsGEkOxLfcodVzK0a4JkOl OjE/GcAQF87YOkoi7PW9MtRho/B4DFGL75AyJWAE96JzlY293ZgwcCDcuyyyDWQW 4NysgpttfHKIoBhCmrbGA0kvbPgrxYjsU0fr18AZmomre94XlveFxQNgA2tWqoM8 FccdLeKfBHaI74VRzvr5oHtewEg1dIHIEuLwqew/RKYqbXZeA19WKiqi3JFm84x8 D6pLu9jwTvKKDvUjh0yuzMe9mqlt2R2/2lCWJEQrcy09zIU6jhw= =chdB -----END PGP SIGNATURE----- --=-=-=--