All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 09/10] PM: EM: Implement em_notify_pd_created/updated().
@ 2025-06-18  9:54 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-06-18  9:54 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250613094428.267791-10-changwoo@igalia.com>
References: <20250613094428.267791-10-changwoo@igalia.com>
TO: Changwoo Min <changwoo@igalia.com>
TO: lukasz.luba@arm.com
TO: rafael@kernel.org
TO: len.brown@intel.com
TO: pavel@kernel.org
CC: christian.loehle@arm.com
CC: tj@kernel.org
CC: kernel-dev@igalia.com
CC: linux-pm@vger.kernel.org
CC: sched-ext@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: Changwoo Min <changwoo@igalia.com>

Hi Changwoo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.16-rc2 next-20250618]
[cannot apply to amd-pstate/linux-next amd-pstate/bleeding-edge]
[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/Changwoo-Min/PM-EM-Add-em-yaml-and-autogen-files/20250613-174859
base:   linus/master
patch link:    https://lore.kernel.org/r/20250613094428.267791-10-changwoo%40igalia.com
patch subject: [PATCH v2 09/10] PM: EM: Implement em_notify_pd_created/updated().
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: x86_64-randconfig-161-20250618 (https://download.01.org/0day-ci/archive/20250618/202506181708.P4eRyPUC-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202506181708.P4eRyPUC-lkp@intel.com/

smatch warnings:
kernel/power/em_netlink.c:249 __em_notify_pd_table() error: uninitialized symbol 'ret'.

vim +/ret +249 kernel/power/em_netlink.c

24b309699bc739 Changwoo Min 2025-06-13  215  
b0668476cf48ef Changwoo Min 2025-06-13  216  
b0668476cf48ef Changwoo Min 2025-06-13  217  /**************************** Event encoding *********************************/
76ab710f256a78 Changwoo Min 2025-06-13  218  static int __em_notify_pd_table(const struct em_perf_domain *pd, int ntf_type)
76ab710f256a78 Changwoo Min 2025-06-13  219  {
76ab710f256a78 Changwoo Min 2025-06-13  220  	struct sk_buff *msg;
76ab710f256a78 Changwoo Min 2025-06-13  221  	int msg_sz, ret;
76ab710f256a78 Changwoo Min 2025-06-13  222  	void *hdr;
76ab710f256a78 Changwoo Min 2025-06-13  223  
76ab710f256a78 Changwoo Min 2025-06-13  224  	if (!genl_has_listeners(&em_nl_family, &init_net, EM_NLGRP_EVENT))
76ab710f256a78 Changwoo Min 2025-06-13  225  		return 0;
76ab710f256a78 Changwoo Min 2025-06-13  226  
76ab710f256a78 Changwoo Min 2025-06-13  227  	msg_sz = __em_nl_get_pd_table_size(pd);
76ab710f256a78 Changwoo Min 2025-06-13  228  
76ab710f256a78 Changwoo Min 2025-06-13  229  	msg = genlmsg_new(msg_sz, GFP_KERNEL);
76ab710f256a78 Changwoo Min 2025-06-13  230  	if (!msg)
76ab710f256a78 Changwoo Min 2025-06-13  231  		return -ENOMEM;
76ab710f256a78 Changwoo Min 2025-06-13  232  
76ab710f256a78 Changwoo Min 2025-06-13  233  	hdr = genlmsg_put(msg, 0, 0, &em_nl_family, 0, ntf_type);
76ab710f256a78 Changwoo Min 2025-06-13  234  	if (!hdr)
76ab710f256a78 Changwoo Min 2025-06-13  235  		goto out_free_msg;
76ab710f256a78 Changwoo Min 2025-06-13  236  
76ab710f256a78 Changwoo Min 2025-06-13  237  	ret = __em_nl_get_pd_table(msg, pd);
76ab710f256a78 Changwoo Min 2025-06-13  238  	if (ret)
76ab710f256a78 Changwoo Min 2025-06-13  239  		goto out_free_msg;
76ab710f256a78 Changwoo Min 2025-06-13  240  
76ab710f256a78 Changwoo Min 2025-06-13  241  	genlmsg_end(msg, hdr);
76ab710f256a78 Changwoo Min 2025-06-13  242  
76ab710f256a78 Changwoo Min 2025-06-13  243  	genlmsg_multicast(&em_nl_family, msg, 0, EM_NLGRP_EVENT, GFP_KERNEL);
76ab710f256a78 Changwoo Min 2025-06-13  244  
76ab710f256a78 Changwoo Min 2025-06-13  245  	return 0;
76ab710f256a78 Changwoo Min 2025-06-13  246  
76ab710f256a78 Changwoo Min 2025-06-13  247  out_free_msg:
76ab710f256a78 Changwoo Min 2025-06-13  248  	nlmsg_free(msg);
76ab710f256a78 Changwoo Min 2025-06-13 @249  	return ret;
76ab710f256a78 Changwoo Min 2025-06-13  250  }
76ab710f256a78 Changwoo Min 2025-06-13  251  

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

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH v2 00/10] PM: EM: Add netlink support for the energy model.
@ 2025-06-13  9:44 Changwoo Min
  2025-06-13  9:44 ` [PATCH v2 09/10] PM: EM: Implement em_notify_pd_created/updated() Changwoo Min
  0 siblings, 1 reply; 3+ messages in thread
From: Changwoo Min @ 2025-06-13  9:44 UTC (permalink / raw)
  To: lukasz.luba, rafael, len.brown, pavel
  Cc: christian.loehle, tj, kernel-dev, linux-pm, sched-ext,
	linux-kernel, Changwoo Min, Rafael J. Wysocki

There is a need to access the energy model from the userspace. One such
example is the sched_ext schedulers [1]. The userspace part of the
sched_ext schedules could feed the (post-processed) energy-model
information to the BPF part of the scheduler.

Currently, debugfs is the only way to read the energy model from userspace;
however, it lacks proper notification mechanisms when a performance domain
and its associated energy model change.

This patch set introduces a generic netlink for the energy model, as
discussed in [2]. It allows a userspace program to read the performance
domain and its energy model. It notifies the userspace program when a
performance domain is created or deleted or its energy model is updated
through a multicast interface.

Specifically, it supports two commands:
  - EM_CMD_GET_PDS: Get the list of information for all performance
    domains.
  - EM_CMD_GET_PD_TABLE: Get the energy model table of a performance
    domain.

Also, it supports three notification events:
  - EM_CMD_PD_CREATED: When a performance domain is created.
  - EM_CMD_PD_DELETED: When a performance domain is deleted.
  - EM_CMD_PD_UPDATED: When the energy model table of a performance domain
    is updated.

This can be tested using the tool, tools/net/ynl/pyynl/cli.py, for example,
with the following commands:

  $> tools/net/ynl/pyynl/cli.py \
     --spec Documentation/netlink/specs/em.yaml \
     --do get-pds
  $> tools/net/ynl/pyynl/cli.py \
     --spec Documentation/netlink/specs/em.yaml \
     --do get-pd-table --json '{"pd-id": 0}'
  $> tools/net/ynl/pyynl/cli.py \
     --spec Documentation/netlink/specs/em.yaml \
     --subscribe event  --sleep 10

[1] https://lwn.net/Articles/922405/
[2] https://lore.kernel.org/lkml/a82423bc-8c38-4d57-93da-c4f20011cc92@arm.com/

ChangeLog v1 -> v2:
  - Use YNL to generate boilerplate code. Overhaul the naming conventions
    (command, event, notification, attribute) to follow the typical
    conventions of other YNL-based netlink implementations.
  - Calculate the exact message size instead of using NLMSG_GOODSIZE
    when allocating a message (genlmsg_new). This avoids the reallocation
    of a message.
  - Remove an unnecessary function, em_netlink_exit(), and initialize the
    netlink (em_netlink_init) at em_netlink.c without touching energy_model.c.

CC: Lukasz Luba <lukasz.luba@arm.com>
CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
CC: Tejun Heo <tj@kernel.org>
Signed-off-by: Changwoo Min <changwoo@igalia.com>

Changwoo Min (10):
  PM: EM: Add em.yaml and autogen files.
  PM: EM: Add a skeleton code for netlink notification.
  PM: EM: Assign a unique ID when creating a performance domain.
  PM: EM: Expose the ID of a performance domain via debugfs.
  PM: EM: Add an iterator and accessor for the performance domain.
  PM: EM: Implement em_nl_get_pds_doit().
  PM: EM: Implement em_nl_get_pd_table_doit().
  PM: EM: Implement em_notify_pd_deleted().
  PM: EM: Implement em_notify_pd_created/updated().
  PM: EM: Notify an event when the performance domain changes.

 Documentation/netlink/specs/em.yaml | 113 ++++++++++
 MAINTAINERS                         |   3 +
 include/linux/energy_model.h        |  19 ++
 include/uapi/linux/energy_model.h   |  62 ++++++
 kernel/power/Makefile               |   5 +-
 kernel/power/em_netlink.c           | 311 ++++++++++++++++++++++++++++
 kernel/power/em_netlink.h           |  34 +++
 kernel/power/em_netlink_autogen.c   |  48 +++++
 kernel/power/em_netlink_autogen.h   |  23 ++
 kernel/power/energy_model.c         |  83 +++++++-
 10 files changed, 699 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/netlink/specs/em.yaml
 create mode 100644 include/uapi/linux/energy_model.h
 create mode 100644 kernel/power/em_netlink.c
 create mode 100644 kernel/power/em_netlink.h
 create mode 100644 kernel/power/em_netlink_autogen.c
 create mode 100644 kernel/power/em_netlink_autogen.h

-- 
2.49.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-18  9:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18  9:54 [PATCH v2 09/10] PM: EM: Implement em_notify_pd_created/updated() kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2025-06-13  9:44 [PATCH v2 00/10] PM: EM: Add netlink support for the energy model Changwoo Min
2025-06-13  9:44 ` [PATCH v2 09/10] PM: EM: Implement em_notify_pd_created/updated() Changwoo Min
2025-06-13 20:02   ` kernel test robot

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.