tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 6a7917c89f219f09b1d88d09f376000914a52763 commit: 7b3e01be8455386a664a68fad0abb5a7611d2664 [5751/6069] s390/cpum_sf: Rework debug_sprintf_event() messages config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20240822/202408221933.w7zzVrjB-lkp@xxxxxxxxx/config) compiler: s390-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240822/202408221933.w7zzVrjB-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202408221933.w7zzVrjB-lkp@xxxxxxxxx/ All warnings (new ones prefixed by >>): arch/s390/kernel/perf_cpum_sf.c: In function 'aux_reset_buffer': >> arch/s390/kernel/perf_cpum_sf.c:1460:43: warning: variable 'idx_old' set but not used [-Wunused-but-set-variable] 1460 | unsigned long i, range_scan, idx, idx_old; | ^~~~~~~ vim +/idx_old +1460 arch/s390/kernel/perf_cpum_sf.c ca5955cdeae744 Pu Hou 2016-11-11 1434 ca5955cdeae744 Pu Hou 2016-11-11 1435 /* ca5955cdeae744 Pu Hou 2016-11-11 1436 * aux_reset_buffer() - Scan and setup SDBs for new samples ca5955cdeae744 Pu Hou 2016-11-11 1437 * @aux: The AUX buffer to set ca5955cdeae744 Pu Hou 2016-11-11 1438 * @range: The range of SDBs to scan started from aux->head ca5955cdeae744 Pu Hou 2016-11-11 1439 * @overflow: Set to overflow count ca5955cdeae744 Pu Hou 2016-11-11 1440 * ca5955cdeae744 Pu Hou 2016-11-11 1441 * Set alert indicator on the SDB at index of aux->alert_mark. If this SDB is ca5955cdeae744 Pu Hou 2016-11-11 1442 * marked as empty, check if it is already set full by the hardware sampler. ca5955cdeae744 Pu Hou 2016-11-11 1443 * If yes, that means new data is already there before we can set an alert ca5955cdeae744 Pu Hou 2016-11-11 1444 * indicator. Caller should try to set alert indicator to some position behind. ca5955cdeae744 Pu Hou 2016-11-11 1445 * ca5955cdeae744 Pu Hou 2016-11-11 1446 * Scan the SDBs in AUX buffer from behind aux->empty_mark. They are used ca5955cdeae744 Pu Hou 2016-11-11 1447 * previously and have already been consumed by user space. Reset these SDBs ca5955cdeae744 Pu Hou 2016-11-11 1448 * (clear full indicator and alert indicator) for new data. ca5955cdeae744 Pu Hou 2016-11-11 1449 * If aux->alert_mark fall in this area, just set it. Overflow count is ca5955cdeae744 Pu Hou 2016-11-11 1450 * recorded while scanning. ca5955cdeae744 Pu Hou 2016-11-11 1451 * ca5955cdeae744 Pu Hou 2016-11-11 1452 * SDBs between aux->head and aux->empty_mark are already reset at last time. ca5955cdeae744 Pu Hou 2016-11-11 1453 * and ready for new samples. So scanning on this area could be skipped. ca5955cdeae744 Pu Hou 2016-11-11 1454 * ca5955cdeae744 Pu Hou 2016-11-11 1455 * Return true if alert indicator is set successfully and false if not. ca5955cdeae744 Pu Hou 2016-11-11 1456 */ ca5955cdeae744 Pu Hou 2016-11-11 1457 static bool aux_reset_buffer(struct aux_buffer *aux, unsigned long range, ca5955cdeae744 Pu Hou 2016-11-11 1458 unsigned long long *overflow) ca5955cdeae744 Pu Hou 2016-11-11 1459 { ee5c4ccfd51d5d Thomas Richter 2019-12-17 @1460 unsigned long i, range_scan, idx, idx_old; 82d3edb50a11bf Heiko Carstens 2023-01-05 1461 union hws_trailer_header old, prev, new; 82d3edb50a11bf Heiko Carstens 2023-01-05 1462 unsigned long long orig_overflow; ca5955cdeae744 Pu Hou 2016-11-11 1463 struct hws_trailer_entry *te; ca5955cdeae744 Pu Hou 2016-11-11 1464 78157b4791a3e3 Thomas Richter 2023-01-13 1465 if (range <= aux_sdb_num_empty(aux)) ca5955cdeae744 Pu Hou 2016-11-11 1466 /* ca5955cdeae744 Pu Hou 2016-11-11 1467 * No need to scan. All SDBs in range are marked as empty. ca5955cdeae744 Pu Hou 2016-11-11 1468 * Just set alert indicator. Should check race with hardware ca5955cdeae744 Pu Hou 2016-11-11 1469 * sampler. ca5955cdeae744 Pu Hou 2016-11-11 1470 */ ca5955cdeae744 Pu Hou 2016-11-11 1471 return aux_set_alert(aux, aux->alert_mark, overflow); ca5955cdeae744 Pu Hou 2016-11-11 1472 ca5955cdeae744 Pu Hou 2016-11-11 1473 if (aux->alert_mark <= aux->empty_mark) ca5955cdeae744 Pu Hou 2016-11-11 1474 /* ca5955cdeae744 Pu Hou 2016-11-11 1475 * Set alert indicator on empty SDB. Should check race ca5955cdeae744 Pu Hou 2016-11-11 1476 * with hardware sampler. ca5955cdeae744 Pu Hou 2016-11-11 1477 */ ca5955cdeae744 Pu Hou 2016-11-11 1478 if (!aux_set_alert(aux, aux->alert_mark, overflow)) ca5955cdeae744 Pu Hou 2016-11-11 1479 return false; ca5955cdeae744 Pu Hou 2016-11-11 1480 ca5955cdeae744 Pu Hou 2016-11-11 1481 /* ca5955cdeae744 Pu Hou 2016-11-11 1482 * Scan the SDBs to clear full and alert indicator used previously. ca5955cdeae744 Pu Hou 2016-11-11 1483 * Start scanning from one SDB behind empty_mark. If the new alert ca5955cdeae744 Pu Hou 2016-11-11 1484 * indicator fall into this range, set it. ca5955cdeae744 Pu Hou 2016-11-11 1485 */ 78157b4791a3e3 Thomas Richter 2023-01-13 1486 range_scan = range - aux_sdb_num_empty(aux); ee5c4ccfd51d5d Thomas Richter 2019-12-17 1487 idx_old = idx = aux->empty_mark + 1; ca5955cdeae744 Pu Hou 2016-11-11 1488 for (i = 0; i < range_scan; i++, idx++) { ca5955cdeae744 Pu Hou 2016-11-11 1489 te = aux_sdb_trailer(aux, idx); 5e02c74905cb00 Heiko Carstens 2023-02-24 1490 prev.val = READ_ONCE_ALIGNED_128(te->header.val); ca5955cdeae744 Pu Hou 2016-11-11 1491 do { 82d3edb50a11bf Heiko Carstens 2023-01-05 1492 old.val = prev.val; 82d3edb50a11bf Heiko Carstens 2023-01-05 1493 new.val = prev.val; 82d3edb50a11bf Heiko Carstens 2023-01-05 1494 orig_overflow = old.overflow; 82d3edb50a11bf Heiko Carstens 2023-01-05 1495 new.f = 0; 82d3edb50a11bf Heiko Carstens 2023-01-05 1496 new.overflow = 0; ca5955cdeae744 Pu Hou 2016-11-11 1497 if (idx == aux->alert_mark) 82d3edb50a11bf Heiko Carstens 2023-01-05 1498 new.a = 1; ca5955cdeae744 Pu Hou 2016-11-11 1499 else 82d3edb50a11bf Heiko Carstens 2023-01-05 1500 new.a = 0; 497cc42bf53b55 Peter Zijlstra 2023-05-31 1501 prev.val = cmpxchg128(&te->header.val, old.val, new.val); 82d3edb50a11bf Heiko Carstens 2023-01-05 1502 } while (prev.val != old.val); ca5955cdeae744 Pu Hou 2016-11-11 1503 *overflow += orig_overflow; ca5955cdeae744 Pu Hou 2016-11-11 1504 } ca5955cdeae744 Pu Hou 2016-11-11 1505 ca5955cdeae744 Pu Hou 2016-11-11 1506 /* Update empty_mark to new position */ ca5955cdeae744 Pu Hou 2016-11-11 1507 aux->empty_mark = aux->head + range - 1; ca5955cdeae744 Pu Hou 2016-11-11 1508 ca5955cdeae744 Pu Hou 2016-11-11 1509 return true; ca5955cdeae744 Pu Hou 2016-11-11 1510 } ca5955cdeae744 Pu Hou 2016-11-11 1511 :::::: The code at line 1460 was first introduced by commit :::::: ee5c4ccfd51d5dbaa9b9ddeed97c8d5526e55f17 s390/cpum_sf: Convert debug trace to common layout :::::: TO: Thomas Richter <tmricht@xxxxxxxxxxxxx> :::::: CC: Vasily Gorbik <gor@xxxxxxxxxxxxx> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki