Received: by 10.213.65.68 with SMTP id h4csp455584imn; Wed, 4 Apr 2018 01:12:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/7aLoJJ60wqg3MiLCHMzUNbj2bm2zajONmoI2b7MnNc1B9UQTcMz2kE6KdXDnP2YTBt7Eq X-Received: by 10.98.152.207 with SMTP id d76mr12971176pfk.130.1522829534216; Wed, 04 Apr 2018 01:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522829534; cv=none; d=google.com; s=arc-20160816; b=PGySTdwJoZDJ+tbn81At5cL1nL6TSEovVbE/CnE4KlEbsUjMqB1JVZCM5Pnmq39CoO JinWMu+fN0c5yvVdX/gWlNL8EWUOwk1cFjPFc7L+SXIPDuNxodAbyARqp14cCdHfrO2N K7FN0HTBHjXyC6uPrqfsPt70fHhecuzHmw5lSSBUOjCT79DNDw6fejdVViGDs0ffBRDh dV7rAeVwspAvUtJh1ThemZKip4rsRYh8DNm+z+ZDrFYWZXu09i0p5LZvkoRzwMTkndWn /1KY9qTmhQ0P1gVDfJzlrhpVki7aIpermeY4oVD+uTjENSmp6Vjk8urkl8fw7D0hJu49 /q+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=+laxeb4kHjoHUsJo7YFQKFCuYTtncmMv5QwNPHDDxZQ=; b=YOhBwske8fGOWTvjxHws21wmVxFkfeZANgvQBfecQPlRZIEyNBy/IGrR2hmfJ/OTvt Z2GhNWYYGNjwL8zHfDwr07r6CtcMZRC9CIUQW4znZUcNeRjkwkNs7nWKxn0T6C4rxOa0 ft/lspjiBoa7TzxmLpzT+5Zdf1UcnF8favITMS/mnkSoBKTrTux400qQP2NENw//OCU/ RUtTgq9eoFlkDxGEbvK970bagRs2LcM1VTeGArJrzlVxIprmdh8PGOBEVW9t04h/f5YT AsjVswDtvQtB5yGT+5dYEgA9diZQ0+GVCNLpsrHml/nck90FF/pwsO/FvAq6JVu008so f1ag== 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 s189si3312346pgb.126.2018.04.04.01.11.59; Wed, 04 Apr 2018 01:12:14 -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 S1751231AbeDDIKr convert rfc822-to-8bit (ORCPT + 99 others); Wed, 4 Apr 2018 04:10:47 -0400 Received: from mga14.intel.com ([192.55.52.115]:32236 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbeDDIKq (ORCPT ); Wed, 4 Apr 2018 04:10:46 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2018 01:10:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,405,1517904000"; d="scan'208";a="34139511" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 04 Apr 2018 01:10:45 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 4 Apr 2018 01:10:45 -0700 Received: from FMSMSX109.amr.corp.intel.com ([169.254.15.178]) by fmsmsx115.amr.corp.intel.com ([169.254.4.26]) with mapi id 14.03.0319.002; Wed, 4 Apr 2018 01:10:45 -0700 From: "Dilger, Andreas" To: NeilBrown CC: James Simmons , "Drokin, Oleg" , Greg Kroah-Hartman , Linux Kernel Mailing List , "Lustre Development List" Subject: Re: [lustre-devel] [PATCH 11/17] staging: lustre: libcfs: discard cfs_time_shift(). Thread-Topic: [lustre-devel] [PATCH 11/17] staging: lustre: libcfs: discard cfs_time_shift(). Thread-Index: AQHTyFmnPaab2m4I+kyw4VsVO58/aKPuV+IAgAAv/ICAAjWlAA== Date: Wed, 4 Apr 2018 08:10:44 +0000 Message-ID: References: <152229732768.27689.4800156943561963977.stgit@noble> <152229760863.27689.4681198496926109808.stgit@noble> <0B6A147C-7E98-4B00-AF32-AF8843484CF9@intel.com> <87muyl1bzs.fsf@notabene.neil.brown.name> In-Reply-To: <87muyl1bzs.fsf@notabene.neil.brown.name> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.8.93] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Apr 2, 2018, at 16:26, NeilBrown wrote: > On Mon, Apr 02 2018, Dilger, Andreas wrote: >> On Mar 30, 2018, at 13:02, James Simmons wrote: >>>> 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. >>>> >>>> Same for cfs_time_shift_64() >>> >>> 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 similar? > > 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? I thought the goal was to avoid hard-coding the HZ value so that kernels could have variable clock rates in the future. Cheers, Andreas > $ 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 > _______________________________________________ > lustre-devel mailing list > lustre-devel@lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation