All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH 2/4] cpuidle: menu: add idle_time to cpuidle_state
Date: Fri, 23 Apr 2021 08:46:54 +0800	[thread overview]
Message-ID: <202104230837.LiuYyOHo-lkp@intel.com> (raw)
In-Reply-To: <1619123448-10138-3-git-send-email-skomatineni@nvidia.com>

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

Hi Sowjanya,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on pm/linux-next]
[also build test ERROR on next-20210422]
[cannot apply to robh/for-next linus/master daniel.lezcano/clockevents/next v5.12-rc8]
[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/Sowjanya-Komatineni/Support-for-passing-runtime-state-idle-time-to-TF-A/20210423-043308
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-s001-20210421 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/072299f9d8ef2e6ed90ddd7ecb17598ff1618b0d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Sowjanya-Komatineni/Support-for-passing-runtime-state-idle-time-to-TF-A/20210423-043308
        git checkout 072299f9d8ef2e6ed90ddd7ecb17598ff1618b0d
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=i386 

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 >>):

   ld: drivers/cpuidle/governors/menu.o: in function `menu_select':
>> drivers/cpuidle/governors/menu.c:398: undefined reference to `__udivdi3'
>> ld: drivers/cpuidle/governors/menu.c:398: undefined reference to `__udivdi3'
>> ld: drivers/cpuidle/governors/menu.c:398: undefined reference to `__udivdi3'
>> ld: drivers/cpuidle/governors/menu.c:398: undefined reference to `__udivdi3'


vim +398 drivers/cpuidle/governors/menu.c

   258	
   259	/**
   260	 * menu_select - selects the next idle state to enter
   261	 * @drv: cpuidle driver containing state data
   262	 * @dev: the CPU
   263	 * @stop_tick: indication on whether or not to stop the tick
   264	 */
   265	static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
   266			       bool *stop_tick)
   267	{
   268		struct menu_device *data = this_cpu_ptr(&menu_devices);
   269		s64 latency_req = cpuidle_governor_latency_req(dev->cpu);
   270		unsigned int predicted_us;
   271		u64 predicted_ns;
   272		u64 interactivity_req;
   273		unsigned long nr_iowaiters;
   274		ktime_t delta, delta_tick;
   275		int i, idx;
   276	
   277		if (data->needs_update) {
   278			menu_update(drv, dev);
   279			data->needs_update = 0;
   280		}
   281	
   282		/* determine the expected residency time, round up */
   283		delta = tick_nohz_get_sleep_length(&delta_tick);
   284		if (unlikely(delta < 0)) {
   285			delta = 0;
   286			delta_tick = 0;
   287		}
   288		data->next_timer_ns = delta;
   289	
   290		nr_iowaiters = nr_iowait_cpu(dev->cpu);
   291		data->bucket = which_bucket(data->next_timer_ns, nr_iowaiters);
   292	
   293		if (unlikely(drv->state_count <= 1 || latency_req == 0) ||
   294		    ((data->next_timer_ns < drv->states[1].target_residency_ns ||
   295		      latency_req < drv->states[1].exit_latency_ns) &&
   296		     !dev->states_usage[0].disable)) {
   297			/*
   298			 * In this case state[0] will be used no matter what, so return
   299			 * it right away and keep the tick running if state[0] is a
   300			 * polling one.
   301			 */
   302			*stop_tick = !(drv->states[0].flags & CPUIDLE_FLAG_POLLING);
   303			return 0;
   304		}
   305	
   306		/* Round up the result for half microseconds. */
   307		predicted_us = div_u64(data->next_timer_ns *
   308				       data->correction_factor[data->bucket] +
   309				       (RESOLUTION * DECAY * NSEC_PER_USEC) / 2,
   310				       RESOLUTION * DECAY * NSEC_PER_USEC);
   311		/* Use the lowest expected idle interval to pick the idle state. */
   312		predicted_ns = (u64)min(predicted_us,
   313					get_typical_interval(data, predicted_us)) *
   314					NSEC_PER_USEC;
   315	
   316		if (tick_nohz_tick_stopped()) {
   317			/*
   318			 * If the tick is already stopped, the cost of possible short
   319			 * idle duration misprediction is much higher, because the CPU
   320			 * may be stuck in a shallow idle state for a long time as a
   321			 * result of it.  In that case say we might mispredict and use
   322			 * the known time till the closest timer event for the idle
   323			 * state selection.
   324			 */
   325			if (predicted_ns < TICK_NSEC)
   326				predicted_ns = data->next_timer_ns;
   327		} else {
   328			/*
   329			 * Use the performance multiplier and the user-configurable
   330			 * latency_req to determine the maximum exit latency.
   331			 */
   332			interactivity_req = div64_u64(predicted_ns,
   333						      performance_multiplier(nr_iowaiters));
   334			if (latency_req > interactivity_req)
   335				latency_req = interactivity_req;
   336		}
   337	
   338		/*
   339		 * Find the idle state with the lowest power while satisfying
   340		 * our constraints.
   341		 */
   342		idx = -1;
   343		for (i = 0; i < drv->state_count; i++) {
   344			struct cpuidle_state *s = &drv->states[i];
   345	
   346			if (dev->states_usage[i].disable)
   347				continue;
   348	
   349			if (idx == -1)
   350				idx = i; /* first enabled state */
   351	
   352			if (s->target_residency_ns > predicted_ns) {
   353				/*
   354				 * Use a physical idle state, not busy polling, unless
   355				 * a timer is going to trigger soon enough.
   356				 */
   357				if ((drv->states[idx].flags & CPUIDLE_FLAG_POLLING) &&
   358				    s->exit_latency_ns <= latency_req &&
   359				    s->target_residency_ns <= data->next_timer_ns) {
   360					predicted_ns = s->target_residency_ns;
   361					idx = i;
   362					break;
   363				}
   364				if (predicted_ns < TICK_NSEC)
   365					break;
   366	
   367				if (!tick_nohz_tick_stopped()) {
   368					/*
   369					 * If the state selected so far is shallow,
   370					 * waking up early won't hurt, so retain the
   371					 * tick in that case and let the governor run
   372					 * again in the next iteration of the loop.
   373					 */
   374					predicted_ns = drv->states[idx].target_residency_ns;
   375					break;
   376				}
   377	
   378				/*
   379				 * If the state selected so far is shallow and this
   380				 * state's target residency matches the time till the
   381				 * closest timer event, select this one to avoid getting
   382				 * stuck in the shallow one for too long.
   383				 */
   384				if (drv->states[idx].target_residency_ns < TICK_NSEC &&
   385				    s->target_residency_ns <= delta_tick) {
   386					drv->states[idx].idle_time = delta_tick / NSEC_PER_USEC;
   387					idx = i;
   388				}
   389	
   390				return idx;
   391			}
   392			if (s->exit_latency_ns > latency_req)
   393				break;
   394	
   395			idx = i;
   396		}
   397	
 > 398		drv->states[idx].idle_time = predicted_ns / NSEC_PER_USEC;
   399		if (idx == -1)
   400			idx = 0; /* No states enabled. Must use 0. */
   401	
   402		/*
   403		 * Don't stop the tick if the selected state is a polling one or if the
   404		 * expected idle duration is shorter than the tick period length.
   405		 */
   406		if (((drv->states[idx].flags & CPUIDLE_FLAG_POLLING) ||
   407		     predicted_ns < TICK_NSEC) && !tick_nohz_tick_stopped()) {
   408			*stop_tick = false;
   409	
   410			if (idx > 0 && drv->states[idx].target_residency_ns > delta_tick) {
   411				/*
   412				 * The tick is not going to be stopped and the target
   413				 * residency of the state to be returned is not within
   414				 * the time until the next timer event including the
   415				 * tick, so try to correct that.
   416				 */
   417				for (i = idx - 1; i >= 0; i--) {
   418					if (dev->states_usage[i].disable)
   419						continue;
   420	
   421					idx = i;
   422					if (drv->states[i].target_residency_ns <= delta_tick)
   423						break;
   424				}
   425	
   426				drv->states[idx].idle_time = delta_tick / NSEC_PER_USEC;
   427			}
   428		}
   429	
   430		return idx;
   431	}
   432	

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

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

  reply	other threads:[~2021-04-23  0:46 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 20:30 [RFC PATCH 0/4] Support for passing runtime state idle time to TF-A Sowjanya Komatineni
2021-04-22 20:30 ` Sowjanya Komatineni
2021-04-22 20:30 ` [RFC PATCH 1/4] firmware/psci: add support for PSCI function SET_STATE_IDLE_TIME Sowjanya Komatineni
2021-04-22 20:30   ` Sowjanya Komatineni
2021-04-22 20:30 ` [RFC PATCH 2/4] cpuidle: menu: add idle_time to cpuidle_state Sowjanya Komatineni
2021-04-22 20:30   ` Sowjanya Komatineni
2021-04-23  0:46   ` kernel test robot [this message]
2021-04-23  1:28   ` kernel test robot
2021-04-23 12:22   ` Rafael J. Wysocki
2021-04-23 12:22     ` Rafael J. Wysocki
2021-04-23 18:33     ` Sowjanya Komatineni
2021-04-23 18:33       ` Sowjanya Komatineni
2021-04-22 20:30 ` [RFC PATCH 3/4] cpuidle: psci: pass state idle time before state enter callback Sowjanya Komatineni
2021-04-22 20:30   ` Sowjanya Komatineni
2021-04-22 20:30 ` [RFC PATCH 4/4] arm64: dts: tegra194: Add CPU idle states Sowjanya Komatineni
2021-04-22 20:30   ` Sowjanya Komatineni
2021-04-23  1:03 ` [RFC PATCH 0/4] Support for passing runtime state idle time to TF-A Sowjanya Komatineni
2021-04-23  1:03   ` Sowjanya Komatineni
2021-04-23 12:27 ` Rafael J. Wysocki
2021-04-23 12:27   ` Rafael J. Wysocki
2021-04-23 18:32   ` Sowjanya Komatineni
2021-04-23 18:32     ` Sowjanya Komatineni
2021-04-23 20:16 ` Lukasz Luba
2021-04-23 20:16   ` Lukasz Luba
2021-04-23 22:24   ` Sowjanya Komatineni
2021-04-23 22:24     ` Sowjanya Komatineni
2021-04-26 10:10     ` Souvik Chakravarty
2021-04-26 10:10       ` Souvik Chakravarty
2021-04-26 13:11     ` Morten Rasmussen
2021-04-26 13:11       ` Morten Rasmussen

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=202104230837.LiuYyOHo-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.