From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8429820097141048118==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH][RFC 1/2] Implement Ziegler-Nichols Heuristic Date: Sat, 11 Dec 2021 23:42:16 +0800 Message-ID: <202112112254.HX7rf2NF-lkp@intel.com> In-Reply-To: <20211210163141.213106-1-chetan.mistry@arm.com> List-Id: --===============8429820097141048118== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Chetankumar, [FYI, it's a private test report for your RFC patch.] [auto build test ERROR on rafael-pm/thermal] [also build test ERROR on linux/master linus/master v5.16-rc4] [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/Chetankumar-Mistry/Impleme= nt-Ziegler-Nichols-Heuristic/20211211-003430 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git= thermal config: i386-randconfig-r034-20211210 (https://download.01.org/0day-ci/arch= ive/20211211/202112112254.HX7rf2NF-lkp(a)intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=3D1 build): # https://github.com/0day-ci/linux/commit/91f16d6a958fcd818cd8649e7= d8d92958ada8c2f git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Chetankumar-Mistry/Implement-Ziegl= er-Nichols-Heuristic/20211211-003430 git checkout 91f16d6a958fcd818cd8649e7d8d92958ada8c2f # save the config file to linux build tree mkdir build_dir make W=3D1 O=3Dbuild_dir ARCH=3Di386 SHELL=3D/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): ld: drivers/thermal/gov_power_allocator.o: in function `ziegler_nichols': >> drivers/thermal/gov_power_allocator.c:477: undefined reference to `__udi= vdi3' vim +477 drivers/thermal/gov_power_allocator.c 455 = 456 /** ziegler_nichols() - Calculate the k_ultimate and period for the = thermal device 457 * and use these values to calculate and set th= e PID coefficients based on 458 * the Ziegler-Nichols Heuristic 459 * @tz - The thermal device we are operating on 460 * @next_err - The next error value to be used for calculati= ons 461 * @control_temp - The temperature we are trying to target 462 * 463 * The Ziegler-Nichols PID Coefficient Tuning Method works by determ= ining a K_Ultimate value. This 464 * is the largest K_P which yields a stable set of oscillations in e= rror. By using historic and 465 * current values of error, this function attempts to determine whet= her or not it is oscillating, 466 * and increment the value of K_Ultimate accordingly. Once it has d= etermined that the system is 467 * oscillating, it calculates the time between "peaks" to determine = its period 468 * 469 */ 470 static inline void ziegler_nichols(struct thermal_zone_device *tz, s= 32 next_err, 471 int control_temp) 472 { 473 struct power_allocator_params *params =3D tz->governor_data; 474 struct zn_coefficients *zn_coeffs =3D params->zn_coeffs; 475 const int NUMBER_OF_OSCILLATIONS =3D 10; 476 = > 477 u32 t_now =3D (u32)(ktime_get_real_ns() / 1000000); 478 enum pivot_type peak_trough =3D MIDPOINT; 479 s32 oscillation_count =3D 0; 480 bool is_pivot; 481 bool is_safe =3D 482 is_temperature_safe((control_temp - next_err), control_temp); 483 = 484 if (tz->tzp->ziegler_nichols =3D=3D ZN_RESET) { 485 reset_ziegler_nichols(zn_coeffs); 486 tz->tzp->ziegler_nichols =3D ZN_ON; 487 } 488 = 489 /* Override default PID Coefficients. These will be updated later a= ccording to the 490 * Heuristic 491 */ 492 tz->tzp->k_po =3D zn_coeffs->k_ultimate; 493 tz->tzp->k_pu =3D zn_coeffs->k_ultimate; 494 tz->tzp->k_i =3D 0; 495 tz->tzp->k_d =3D 0; 496 = 497 if (!zn_coeffs->zn_found) { 498 /* Make sure that the previous errors have been logged and this is= n't executed on 499 * first pass 500 */ 501 if (zn_coeffs->curr_err !=3D zn_coeffs->prev_err && 502 zn_coeffs->prev_err !=3D 0) { 503 if (!is_safe) 504 goto set_zn; 505 is_pivot =3D is_error_pivot(next_err, zn_coeffs->curr_err, 506 zn_coeffs->prev_err, 507 &peak_trough); 508 if (is_pivot) { 509 oscillation_count =3D get_oscillation_count( 510 zn_coeffs->curr_err, peak_trough, 511 zn_coeffs); 512 if (oscillation_count >=3D 513 NUMBER_OF_OSCILLATIONS) { 514 goto set_zn; 515 } 516 if (peak_trough =3D=3D PEAK) 517 zn_coeffs->t_prev_peak =3D t_now; 518 } 519 if (!is_pivot || !oscillation_count) 520 zn_coeffs->k_ultimate +=3D 10; 521 } 522 goto update_errors; 523 } else { 524 set_zn_pid_coefficients(tz->tzp, zn_coeffs->period, 525 zn_coeffs->k_ultimate); 526 tz->tzp->ziegler_nichols =3D ZN_OFF; 527 } 528 return; 529 = 530 update_errors: 531 zn_coeffs->prev_err =3D zn_coeffs->curr_err; 532 zn_coeffs->curr_err =3D next_err; 533 return; 534 = 535 set_zn: 536 if (zn_coeffs->t_prev_peak) { 537 zn_coeffs->zn_found =3D true; 538 zn_coeffs->period =3D abs(t_now - zn_coeffs->t_prev_peak); 539 set_zn_pid_coefficients(tz->tzp, zn_coeffs->period, 540 zn_coeffs->k_ultimate); 541 ((struct power_allocator_params *)tz->governor_data) 542 ->err_integral =3D 0; 543 tz->tzp->ziegler_nichols =3D ZN_OFF; 544 } else { 545 if (peak_trough =3D=3D PEAK) 546 zn_coeffs->t_prev_peak =3D t_now; 547 } 548 } 549 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============8429820097141048118==--