All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org, Zicheng Qu <quzicheng@huawei.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:OLK-6.6 3355/3355] kernel/xsched/cfs.c:22:6: warning: no previous prototype for function 'xs_rq_add'
Date: Fri, 28 Nov 2025 23:27:30 +0800	[thread overview]
Message-ID: <202511282349.cceTk3rf-lkp@intel.com> (raw)

tree:   https://gitee.com/openeuler/kernel.git OLK-6.6
head:   ae3faae9efa6dabe1e7613b5e5d3758ffaefb86a
commit: 024b851138509252da4531dc2e69b1e8df50fd3b [3355/3355] xsched: Add xsched CFS class
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20251128/202511282349.cceTk3rf-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9e9fe08b16ea2c4d9867fb4974edf2a3776d6ece)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251128/202511282349.cceTk3rf-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511282349.cceTk3rf-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/xsched/cfs.c:22:6: warning: no previous prototype for function 'xs_rq_add' [-Wmissing-prototypes]
      22 | void xs_rq_add(struct xsched_entity_cfs *xse)
         |      ^
   kernel/xsched/cfs.c:22:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      22 | void xs_rq_add(struct xsched_entity_cfs *xse)
         | ^
         | static 
>> kernel/xsched/cfs.c:45:6: warning: no previous prototype for function 'xs_rq_remove' [-Wmissing-prototypes]
      45 | void xs_rq_remove(struct xsched_entity_cfs *xse)
         |      ^
   kernel/xsched/cfs.c:45:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      45 | void xs_rq_remove(struct xsched_entity_cfs *xse)
         | ^
         | static 
>> kernel/xsched/cfs.c:159:6: warning: no previous prototype for function 'rq_init_fair' [-Wmissing-prototypes]
     159 | void rq_init_fair(struct xsched_cu *xcu)
         |      ^
   kernel/xsched/cfs.c:159:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     159 | void rq_init_fair(struct xsched_cu *xcu)
         | ^
         | static 
>> kernel/xsched/cfs.c:164:6: warning: no previous prototype for function 'xse_init_fair' [-Wmissing-prototypes]
     164 | void xse_init_fair(struct xsched_entity *xse)
         |      ^
   kernel/xsched/cfs.c:164:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     164 | void xse_init_fair(struct xsched_entity *xse)
         | ^
         | static 
>> kernel/xsched/cfs.c:169:6: warning: no previous prototype for function 'xse_deinit_fair' [-Wmissing-prototypes]
     169 | void xse_deinit_fair(struct xsched_entity *xse)
         |      ^
   kernel/xsched/cfs.c:169:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     169 | void xse_deinit_fair(struct xsched_entity *xse)
         | ^
         | static 
   5 warnings generated.


vim +/xs_rq_add +22 kernel/xsched/cfs.c

    18	
    19	#define CFS_INNER_RQ_EMPTY(cfs_xse)                                            \
    20		((cfs_xse)->xruntime == XSCHED_TIME_INF)
    21	
  > 22	void xs_rq_add(struct xsched_entity_cfs *xse)
    23	{
    24		struct xsched_rq_cfs *cfs_rq = xse->cfs_rq;
    25		struct rb_node **link = &cfs_rq->ctx_timeline.rb_root.rb_node;
    26		struct rb_node *parent = NULL;
    27		struct xsched_entity_cfs *entry;
    28		bool leftmost = true;
    29	
    30		while (*link) {
    31			parent = *link;
    32			entry = rb_entry(parent, struct xsched_entity_cfs, run_node);
    33			if (xse->xruntime <= entry->xruntime) {
    34				link = &parent->rb_left;
    35			} else {
    36				link = &parent->rb_right;
    37				leftmost = false;
    38			}
    39		}
    40	
    41		rb_link_node(&xse->run_node, parent, link);
    42		rb_insert_color_cached(&xse->run_node, &cfs_rq->ctx_timeline, leftmost);
    43	}
    44	
  > 45	void xs_rq_remove(struct xsched_entity_cfs *xse)
    46	{
    47		struct xsched_rq_cfs *cfs_rq = xse->cfs_rq;
    48	
    49		rb_erase_cached(&xse->run_node, &cfs_rq->ctx_timeline);
    50	}
    51	
    52	/**
    53	 * xs_cfs_rq_update() - Update entity's runqueue position with new xruntime
    54	 */
    55	static void xs_cfs_rq_update(struct xsched_entity_cfs *xse_cfs, u64 new_xrt)
    56	{
    57		xs_rq_remove(xse_cfs);
    58		xse_cfs->xruntime = new_xrt;
    59		xs_rq_add(xse_cfs);
    60	}
    61	
    62	static inline struct xsched_entity_cfs *
    63	xs_pick_first(struct xsched_rq_cfs *cfs_rq)
    64	{
    65		struct xsched_entity_cfs *xse_cfs;
    66		struct rb_node *left = rb_first_cached(&cfs_rq->ctx_timeline);
    67	
    68		if (!left)
    69			return NULL;
    70	
    71		xse_cfs = rb_entry(left, struct xsched_entity_cfs, run_node);
    72		return xse_cfs;
    73	}
    74	
    75	/**
    76	 * xs_update() - Account xruntime and runtime metrics.
    77	 * @xse_cfs: Point to CFS scheduling entity.
    78	 * @delta: Execution time in last period
    79	 */
    80	static void xs_update(struct xsched_entity_cfs *xse_cfs, u64 delta)
    81	{
    82		u64 new_xrt = xse_cfs->xruntime + delta * xse_cfs->weight;
    83	
    84		xs_cfs_rq_update(xse_cfs, new_xrt);
    85		xse_cfs->sum_exec_runtime += delta;
    86	}
    87	
    88	/*
    89	 * Xsched Fair class methods
    90	 * For rq manipulation we rely on root runqueue lock already acquired in core.
    91	 * Access xsched_group_xcu_priv requires no locks because one thread per XCU.
    92	 */
    93	static void dequeue_ctx_fair(struct xsched_entity *xse)
    94	{
    95		struct xsched_cu *xcu = xse->xcu;
    96		struct xsched_entity_cfs *first;
    97		struct xsched_entity_cfs *xse_cfs = &xse->cfs;
    98	
    99		xs_rq_remove(xse_cfs);
   100	
   101		first = xs_pick_first(&xcu->xrq.cfs);
   102		xcu->xrq.cfs.min_xruntime = (first) ? first->xruntime : XSCHED_TIME_INF;
   103	}
   104	
   105	/**
   106	 * enqueue_ctx_fair() - Add context to the runqueue
   107	 * @xse: xsched entity of context
   108	 * @xcu: executor
   109	 *
   110	 * In contrary to enqueue_task it is called once on context init.
   111	 * Although groups reside in tree, their nodes not counted in nr_running.
   112	 * The xruntime of a group xsched entitry represented by min xruntime inside.
   113	 */
   114	static void enqueue_ctx_fair(struct xsched_entity *xse, struct xsched_cu *xcu)
   115	{
   116		struct xsched_entity_cfs *first;
   117		struct xsched_rq_cfs *rq;
   118		struct xsched_entity_cfs *xse_cfs = &xse->cfs;
   119	
   120		rq = xse_cfs->cfs_rq = &xcu->xrq.cfs;
   121	
   122		/* If no XSE of only empty groups */
   123		if (xs_pick_first(rq) == NULL || rq->min_xruntime == XSCHED_TIME_INF)
   124			rq->min_xruntime = xse_cfs->xruntime;
   125		else
   126			xse_cfs->xruntime = max(xse_cfs->xruntime, rq->min_xruntime);
   127	
   128		xs_rq_add(xse_cfs);
   129	
   130		first = xs_pick_first(&xcu->xrq.cfs);
   131		xcu->xrq.cfs.min_xruntime = (first) ? first->xruntime : XSCHED_TIME_INF;
   132	}
   133	
   134	static struct xsched_entity *pick_next_ctx_fair(struct xsched_cu *xcu)
   135	{
   136		struct xsched_entity_cfs *xse;
   137		struct xsched_rq_cfs *rq = &xcu->xrq.cfs;
   138	
   139		xse = xs_pick_first(rq);
   140		if (!xse)
   141			return NULL;
   142	
   143		return container_of(xse, struct xsched_entity, cfs);
   144	}
   145	
   146	static inline bool
   147	xs_should_preempt_fair(struct xsched_entity *xse)
   148	{
   149		return (atomic_read(&xse->submitted_one_kick) >= XSCHED_CFS_KICK_SLICE);
   150	}
   151	
   152	static void put_prev_ctx_fair(struct xsched_entity *xse)
   153	{
   154		struct xsched_entity_cfs *prev = &xse->cfs;
   155	
   156		xs_update(prev, xse->last_exec_runtime);
   157	}
   158	
 > 159	void rq_init_fair(struct xsched_cu *xcu)
   160	{
   161		xcu->xrq.cfs.ctx_timeline = RB_ROOT_CACHED;
   162	}
   163	
 > 164	void xse_init_fair(struct xsched_entity *xse)
   165	{
   166		xse->cfs.weight = XSCHED_CFS_WEIGHT_DFLT;
   167	}
   168	
 > 169	void xse_deinit_fair(struct xsched_entity *xse)
   170	{
   171		/* TODO Cgroup exit */
   172	}
   173	

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

                 reply	other threads:[~2025-11-28 15:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202511282349.cceTk3rf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kernel@openeuler.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=quzicheng@huawei.com \
    /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.