linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Paul E. McKenney" <paulmck@kernel.org>, tglx@linutronix.de
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	john.stultz@linaro.org, sboyd@kernel.org, corbet@lwn.net,
	Mark.Rutland@arm.com, maz@kernel.org, kernel-team@fb.com,
	neeraju@codeaurora.org, ak@linux.intel.com
Subject: Re: [PATCH v11 clocksource 6/6] clocksource: Reduce clocksource-skew threshold for TSC
Date: Thu, 29 Apr 2021 15:02:36 +0800	[thread overview]
Message-ID: <202104291438.PuHsxRkl-lkp@intel.com> (raw)
In-Reply-To: <20210429013037.3958717-6-paulmck@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 6070 bytes --]

Hi "Paul,

I love your patch! Yet something to improve:

[auto build test ERROR on tip/timers/core]
[also build test ERROR on tip/x86/core linux/master linus/master v5.12]
[cannot apply to next-20210428]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Paul-E-McKenney/Do-not-mark-clocks-unstable-due-to-delays-for-v5-13/20210429-093259
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 2d036dfa5f10df9782f5278fc591d79d283c1fad
config: riscv-randconfig-p002-20210428 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/26be1e45593936a0c04aa1d268522f8c1cb646de
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Paul-E-McKenney/Do-not-mark-clocks-unstable-due-to-delays-for-v5-13/20210429-093259
        git checkout 26be1e45593936a0c04aa1d268522f8c1cb646de
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/time/clocksource.c: In function '__clocksource_update_freq_scale':
>> kernel/time/clocksource.c:1094:36: error: 'WATCHDOG_MAX_SKEW' undeclared (first use in this function)
    1094 |   if (cs->uncertainty_margin < 2 * WATCHDOG_MAX_SKEW)
         |                                    ^~~~~~~~~~~~~~~~~
   kernel/time/clocksource.c:1094:36: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/time/clocksource.c:1097:28: error: 'WATCHDOG_THRESHOLD' undeclared (first use in this function)
    1097 |   cs->uncertainty_margin = WATCHDOG_THRESHOLD;
         |                            ^~~~~~~~~~~~~~~~~~


vim +/WATCHDOG_MAX_SKEW +1094 kernel/time/clocksource.c

  1039	
  1040	/**
  1041	 * __clocksource_update_freq_scale - Used update clocksource with new freq
  1042	 * @cs:		clocksource to be registered
  1043	 * @scale:	Scale factor multiplied against freq to get clocksource hz
  1044	 * @freq:	clocksource frequency (cycles per second) divided by scale
  1045	 *
  1046	 * This should only be called from the clocksource->enable() method.
  1047	 *
  1048	 * This *SHOULD NOT* be called directly! Please use the
  1049	 * __clocksource_update_freq_hz() or __clocksource_update_freq_khz() helper
  1050	 * functions.
  1051	 */
  1052	void __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq)
  1053	{
  1054		u64 sec;
  1055	
  1056		/*
  1057		 * Default clocksources are *special* and self-define their mult/shift.
  1058		 * But, you're not special, so you should specify a freq value.
  1059		 */
  1060		if (freq) {
  1061			/*
  1062			 * Calc the maximum number of seconds which we can run before
  1063			 * wrapping around. For clocksources which have a mask > 32-bit
  1064			 * we need to limit the max sleep time to have a good
  1065			 * conversion precision. 10 minutes is still a reasonable
  1066			 * amount. That results in a shift value of 24 for a
  1067			 * clocksource with mask >= 40-bit and f >= 4GHz. That maps to
  1068			 * ~ 0.06ppm granularity for NTP.
  1069			 */
  1070			sec = cs->mask;
  1071			do_div(sec, freq);
  1072			do_div(sec, scale);
  1073			if (!sec)
  1074				sec = 1;
  1075			else if (sec > 600 && cs->mask > UINT_MAX)
  1076				sec = 600;
  1077	
  1078			clocks_calc_mult_shift(&cs->mult, &cs->shift, freq,
  1079					       NSEC_PER_SEC / scale, sec * scale);
  1080		}
  1081	
  1082		/*
  1083		 * If the uncertainty margin is not specified, calculate it.
  1084		 * If both scale and freq are non-zero, calculate the clock
  1085		 * period, but bound below at 2*WATCHDOG_MAX_SKEW.  However,
  1086		 * if either of scale or freq is zero, be very conservative and
  1087		 * take the tens-of-milliseconds WATCHDOG_THRESHOLD value for the
  1088		 * uncertainty margin.  Allow stupidly small uncertainty margins
  1089		 * to be specified by the caller for testing purposes, but warn
  1090		 * to discourage production use of this capability.
  1091		 */
  1092		if (scale && freq && !cs->uncertainty_margin) {
  1093			cs->uncertainty_margin = NSEC_PER_SEC / (scale * freq);
> 1094			if (cs->uncertainty_margin < 2 * WATCHDOG_MAX_SKEW)
  1095				cs->uncertainty_margin = 2 * WATCHDOG_MAX_SKEW;
  1096		} else if (!cs->uncertainty_margin) {
> 1097			cs->uncertainty_margin = WATCHDOG_THRESHOLD;
  1098		}
  1099		WARN_ON_ONCE(cs->uncertainty_margin < 2 * WATCHDOG_MAX_SKEW);
  1100	
  1101		/*
  1102		 * Ensure clocksources that have large 'mult' values don't overflow
  1103		 * when adjusted.
  1104		 */
  1105		cs->maxadj = clocksource_max_adjustment(cs);
  1106		while (freq && ((cs->mult + cs->maxadj < cs->mult)
  1107			|| (cs->mult - cs->maxadj > cs->mult))) {
  1108			cs->mult >>= 1;
  1109			cs->shift--;
  1110			cs->maxadj = clocksource_max_adjustment(cs);
  1111		}
  1112	
  1113		/*
  1114		 * Only warn for *special* clocksources that self-define
  1115		 * their mult/shift values and don't specify a freq.
  1116		 */
  1117		WARN_ONCE(cs->mult + cs->maxadj < cs->mult,
  1118			"timekeeping: Clocksource %s might overflow on 11%% adjustment\n",
  1119			cs->name);
  1120	
  1121		clocksource_update_max_deferment(cs);
  1122	
  1123		pr_info("%s: mask: 0x%llx max_cycles: 0x%llx, max_idle_ns: %lld ns\n",
  1124			cs->name, cs->mask, cs->max_cycles, cs->max_idle_ns);
  1125	}
  1126	EXPORT_SYMBOL_GPL(__clocksource_update_freq_scale);
  1127	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27081 bytes --]

  reply	other threads:[~2021-04-29  7:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29  1:29 [PATCH V11 clocksource 0/6] Do not mark clocks unstable due to delays for v5.13 Paul E. McKenney
2021-04-29  1:30 ` [PATCH v11 clocksource 1/6] clocksource: Provide module parameters to inject delays in watchdog Paul E. McKenney
2021-04-29  1:30 ` [PATCH v11 clocksource 2/6] clocksource: Retry clock read if long delays detected Paul E. McKenney
2021-04-29  1:30 ` [PATCH v11 clocksource 3/6] clocksource: Check per-CPU clock synchronization when marked unstable Paul E. McKenney
2021-04-29  1:30 ` [PATCH v11 clocksource 4/6] clocksource: Provide a module parameter to fuzz per-CPU clock checking Paul E. McKenney
2021-04-29  1:30 ` [PATCH v11 clocksource 5/6] clocksource: Limit number of CPUs checked for clock synchronization Paul E. McKenney
2021-04-29  1:30 ` [PATCH v11 clocksource 6/6] clocksource: Reduce clocksource-skew threshold for TSC Paul E. McKenney
2021-04-29  7:02   ` kernel test robot [this message]
2021-04-29 14:04     ` Paul E. McKenney
2021-04-29 11:13 ` [PATCH V11 clocksource 0/6] Do not mark clocks unstable due to delays for v5.13 Luming Yu
2021-04-30  5:10   ` Paul E. McKenney
2021-04-30  6:52     ` Luming Yu
2021-05-01  4:28       ` Paul E. McKenney
2021-06-02  5:10         ` Luming Yu
2021-06-02 17:46           ` Paul E. McKenney
2021-06-02 18:24             ` Paul E. McKenney
2021-06-03  4:25               ` Luming Yu
2021-06-03 14:40                 ` Paul E. McKenney
2021-06-04  4:23                   ` Luming Yu
2021-06-04 20:26                     ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202104291438.PuHsxRkl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Mark.Rutland@arm.com \
    --cc=ak@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=john.stultz@linaro.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=neeraju@codeaurora.org \
    --cc=paulmck@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).