lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 29 Jun 2024 08:20:11 +0800
From: kernel test robot <lkp@...el.com>
To: Xavier <xavier_qy@....com>, mingo@...hat.com, peterz@...radead.org,
	juri.lelli@...hat.com, vincent.guittot@...aro.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
	mgorman@...e.de, bristot@...hat.com, vschneid@...hat.com,
	linux-kernel@...r.kernel.org, Xavier <xavier_qy@....com>
Subject: Re: [PATCH-RT sched v1 1/2] RT SCHED: Optimize the enqueue and
 dequeue operations for rt_se

Hi Xavier,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on shuah-kselftest/next shuah-kselftest/fixes peterz-queue/sched/core linus/master v6.10-rc5 next-20240628]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Xavier/RT-SCHED-Optimize-the-enqueue-and-dequeue-operations-for-rt_se/20240628-211332
base:   tip/sched/core
patch link:    https://lore.kernel.org/r/20240627172156.235421-2-xavier_qy%40163.com
patch subject: [PATCH-RT sched v1 1/2] RT SCHED: Optimize the enqueue and dequeue operations for rt_se
config: s390-allnoconfig
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 326ba38a991250a8587a399a260b0f7af2c9166a)
reproduce (this is a W=1 build):

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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406290757.qGal0V0S-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/sched/build_policy.c:24:
   In file included from include/linux/livepatch.h:12:
   In file included from include/linux/module.h:19:
   In file included from include/linux/elf.h:6:
   In file included from arch/s390/include/asm/elf.h:173:
   In file included from arch/s390/include/asm/mmu_context.h:11:
   In file included from arch/s390/include/asm/pgalloc.h:18:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   In file included from kernel/sched/build_policy.c:34:
   In file included from kernel/sched/sched.h:63:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:22:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                                                           ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
     102 | #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
         |                                                      ^
   In file included from kernel/sched/build_policy.c:34:
   In file included from kernel/sched/sched.h:63:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:22:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                                                           ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
     115 | #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
         |                                                      ^
   In file included from kernel/sched/build_policy.c:34:
   In file included from kernel/sched/sched.h:63:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:22:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     693 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     701 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     709 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     718 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     727 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     736 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   In file included from kernel/sched/build_policy.c:45:
>> kernel/sched/rt.c:1560:16: error: no member named 'parent' in 'struct sched_rt_entity'
    1560 |                         if (!rt_se->parent) {
         |                              ~~~~~  ^
   kernel/sched/rt.c:1575:16: error: no member named 'parent' in 'struct sched_rt_entity'
    1575 |                         if (!rt_se->parent)
         |                              ~~~~~  ^
   kernel/sched/rt.c:1616:18: error: no member named 'parent' in 'struct sched_rt_entity'
    1616 |                 rt_se = rt_se->parent;
         |                         ~~~~~  ^
   kernel/sched/rt.c:1662:18: error: no member named 'parent' in 'struct sched_rt_entity'
    1662 |                 rt_se = rt_se->parent;
         |                         ~~~~~  ^
   13 warnings and 4 errors generated.


vim +1560 kernel/sched/rt.c

  1473	
  1474	/*
  1475	 * To optimize the enqueue and dequeue of rt_se, this strategy employs a
  1476	 * bottom-up removal approach. Specifically, when removing an rt_se at a
  1477	 * certain level, if it is determined that the highest priority of the rq
  1478	 * associated with that rt_se has not changed, there is no need to continue
  1479	 * removing rt_se at higher levels. At this point, only the total number
  1480	 * of removed rt_se needs to be recorded, and the rt_nr_running count of
  1481	 * higher-level rq should be removed accordingly.
  1482	 *
  1483	 * For enqueue operations, if an rt_se at a certain level is in the rq,
  1484	 * it is still necessary to check the priority of the higher-level rq.
  1485	 * If the priority of the higher-level rq is found to be lower than that
  1486	 * of the rt_se to be added, it should be removed, as updating the highest
  1487	 * priority of the rq during addition will cause the rq to be repositioned
  1488	 * in the parent rq.
  1489	 *
  1490	 * Conversely, for dequeue operations, if an rt_se at a certain level is
  1491	 * not in the rq, the operation can be exited immediately to reduce
  1492	 * unnecessary checks and handling.
  1493	 *
  1494	 * The return value refers to the last rt_se that was removed for enqueue
  1495	 * operations. And for dequeue operations, it refers to the last rt_se
  1496	 * that was either removed or had its rt_nr_running updated.
  1497	 */
  1498	static struct sched_rt_entity *dequeue_rt_stack(struct sched_rt_entity *rt_se,
  1499							unsigned int flags, int for_enqueue)
  1500	{
  1501		struct sched_rt_entity *last = rt_se;
  1502		struct sched_rt_entity *origin = rt_se;
  1503		unsigned int del_rt_nr = 0;
  1504		unsigned int del_rr_nr = 0;
  1505		int prio_changed = rt_se_prio(rt_se);
  1506		int sub_on_rq = 1;
  1507	
  1508		for_each_sched_rt_entity(rt_se) {
  1509			if (on_rt_rq(rt_se)) {
  1510				if (sub_on_rq) {
  1511					/*
  1512					 * The number of tasks removed from the sub-level rt_se also needs
  1513					 * to be subtracted from the rq of the current rt_se, as the current
  1514					 * rt_se's rq no longer includes the number of removed tasks.
  1515					 */
  1516					dec_rq_nr_running(rt_se, del_rt_nr, del_rr_nr);
  1517	
  1518					if (prio_changed) {
  1519						/*
  1520						 * If the removal of the lower-level rt_se causes the
  1521						 * highest priority of the current rq to change, then the
  1522						 * current rt_se also needs to be removed from its parent
  1523						 * rq, and the number of deleted tasks should be
  1524						 * accumulated.
  1525						 */
  1526						del_rt_nr += rt_se_nr_running(rt_se);
  1527						del_rr_nr += rt_se_rr_nr_running(rt_se);
  1528						prio_changed = __dequeue_rt_entity(rt_se,
  1529										prio_changed, flags);
  1530						last = rt_se;
  1531					} else if (!for_enqueue) {
  1532						/* For dequeue, last may only rt_nr_running was modified.*/
  1533						last = rt_se;
  1534					}
  1535				} else {
  1536					/*
  1537					 * Entering this branch must be for enqueue, as dequeue would break
  1538					 * if an rt_se is not online.
  1539					 * If the sub-level node is not online, and the current rt_se's
  1540					 * priority is lower than the one being added, current rt_se need
  1541					 * to be removed.
  1542					 */
  1543					prio_changed = rt_se_prio(rt_se);
  1544					if (prio_changed > rt_se_prio(origin)) {
  1545						del_rt_nr += rt_se_nr_running(rt_se);
  1546						del_rr_nr += rt_se_rr_nr_running(rt_se);
  1547						prio_changed = __dequeue_rt_entity(rt_se,
  1548										prio_changed, flags);
  1549						last = rt_se;
  1550					} else {
  1551						prio_changed = 0;
  1552					}
  1553				}
  1554	
  1555				/*
  1556				 * If the current rt_se is on the top rt_rq, then the already deleted
  1557				 * nodes, plus the count of the rt_rq where current rt_se located,
  1558				 * need to be removed from the top_rt_rq.
  1559				 */
> 1560				if (!rt_se->parent) {
  1561					dequeue_top_rt_rq(rt_rq_of_se(rt_se),
  1562							del_rt_nr + rt_rq_of_se(rt_se)->rt_nr_running);
  1563				}
  1564				sub_on_rq = 1;
  1565			} else if (for_enqueue) {
  1566				/*
  1567				 * In the case of an enqueue operation, if a certain level is found to be
  1568				 * not online, then the previous counts need to be reset to zero.
  1569				 */
  1570				prio_changed = 0;
  1571				sub_on_rq = 0;
  1572				del_rt_nr = 0;
  1573				del_rr_nr = 0;
  1574	
  1575				if (!rt_se->parent)
  1576					dequeue_top_rt_rq(rt_rq_of_se(rt_se),
  1577							rt_rq_of_se(rt_se)->rt_nr_running);
  1578			} else {
  1579				last = rt_se;
  1580				break;
  1581			}
  1582		}
  1583	
  1584		return last;
  1585	}
  1586	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

View attachment "reproduce" of type "text/plain" (808 bytes)

View attachment "config" of type "text/plain" (29165 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ