Linux Power Management development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Zhongqiu Han <quic_zhonhan@quicinc.com>,
	rafael@kernel.org, pavel@kernel.org, len.brown@intel.com
Cc: oe-kbuild-all@lists.linux.dev, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, quic_zhonhan@quicinc.com
Subject: Re: [PATCH] PM: QoS: Add support for CPU affinity mask-based CPUs latency QoS
Date: Fri, 25 Apr 2025 18:17:06 +0800	[thread overview]
Message-ID: <202504251805.5dAJMVbD-lkp@intel.com> (raw)
In-Reply-To: <20250424095228.1112558-1-quic_zhonhan@quicinc.com>

Hi Zhongqiu,

kernel test robot noticed the following build warnings:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v6.15-rc3 next-20250424]
[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/Zhongqiu-Han/PM-QoS-Add-support-for-CPU-affinity-mask-based-CPUs-latency-QoS/20250424-175559
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link:    https://lore.kernel.org/r/20250424095228.1112558-1-quic_zhonhan%40quicinc.com
patch subject: [PATCH] PM: QoS: Add support for CPU affinity mask-based CPUs latency QoS
config: i386-buildonly-randconfig-001-20250425 (https://download.01.org/0day-ci/archive/20250425/202504251805.5dAJMVbD-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250425/202504251805.5dAJMVbD-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/202504251805.5dAJMVbD-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/power/qos.c:344: warning: Function parameter or struct member 'cpu' not described in 'wakeup_qos_affinity_idle_cpu'
>> kernel/power/qos.c:368: warning: Function parameter or struct member 'latency_value' not described in 'cpu_latency_qos_affinity_add'
>> kernel/power/qos.c:368: warning: Excess function parameter 'new_value' description in 'cpu_latency_qos_affinity_add'
>> kernel/power/qos.c:479: warning: Function parameter or struct member 'pm_reqs' not described in 'cpu_latency_qos_affinity_release'
>> kernel/power/qos.c:479: warning: Excess function parameter 'pm_req' description in 'cpu_latency_qos_affinity_release'


vim +344 kernel/power/qos.c

   339	
   340	/**
   341	 * wakeup_qos_affinity_idle_cpu - break one specific cpu out of idle.
   342	 */
   343	void wakeup_qos_affinity_idle_cpu(int cpu)
 > 344	{
   345		preempt_disable();
   346		if (cpu != smp_processor_id() && cpu_online(cpu))
   347			wake_up_if_idle(cpu);
   348		preempt_enable();
   349	}
   350	
   351	/**
   352	 * cpu_latency_qos_affinity_add - Add new CPU affinity latency QoS request.
   353	 * @pm_req : Pointer to a preallocated handle.
   354	 * @affinity_mask: Mask to determine which CPUs need latency QoS.
   355	 * @new_value: New requested constraint value.
   356	 *
   357	 * Use @latency_value to initialize the request handle pointed to by @pm_req,
   358	 * insert it as a new entry to the CPU latency QoS list and recompute the
   359	 * effective QoS constraint for that list, @affinity_mask determine which CPUs
   360	 * need the latency QoS.
   361	 *
   362	 * Callers need to save the handle for later use in updates and removal of the
   363	 * QoS request represented by it.
   364	 */
   365	int cpu_latency_qos_affinity_add(struct cpu_affinity_qos_req *pm_req,
   366					 const cpumask_t *affinity_mask,
   367					 s32 latency_value)
 > 368	{
   369		int cpu;
   370		cpumask_t actual_mask;
   371		struct cpu_affinity_qos_req *cpu_pm_req;
   372		int ret = 0;
   373	
   374		if (!pm_req)
   375			pr_err("%s: invalid PM Qos request\n", __func__);
   376	
   377		INIT_LIST_HEAD(&pm_req->list);
   378	
   379		if (!affinity_mask || cpumask_empty(affinity_mask) ||
   380		    latency_value < 0) {
   381			pr_err("%s: invalid PM Qos request value\n", __func__);
   382			return -EINVAL;
   383		}
   384	
   385		for_each_cpu(cpu, affinity_mask) {
   386			cpu_pm_req = kzalloc(sizeof(struct cpu_affinity_qos_req),
   387					     GFP_KERNEL);
   388			if (!cpu_pm_req) {
   389				ret = -ENOMEM;
   390				goto out_err;
   391			}
   392			ret = dev_pm_qos_add_request(get_cpu_device(cpu),
   393						     &cpu_pm_req->req,
   394						     DEV_PM_QOS_RESUME_LATENCY,
   395						     latency_value);
   396			if (ret < 0) {
   397				pr_err("failed to add latency req for cpu%d", cpu);
   398				kfree(cpu_pm_req);
   399				goto out_err;
   400			} else if (ret > 0) {
   401				wakeup_qos_affinity_idle_cpu(cpu);
   402			}
   403	
   404			cpumask_set_cpu(cpu, &actual_mask);
   405			list_add(&cpu_pm_req->list, &pm_req->list);
   406		}
   407	
   408		pr_info("PM Qos latency: %d added on cpus %*pb\n", latency_value,
   409			cpumask_pr_args(&actual_mask));
   410	
   411		return ret;
   412	
   413	out_err:
   414		cpu_latency_qos_affinity_release(&pm_req->list);
   415		pr_err("failed to add PM QoS latency req, removed all added requests\n");
   416		return ret;
   417	}
   418	EXPORT_SYMBOL_GPL(cpu_latency_qos_affinity_add);
   419	
   420	/**
   421	 * cpu_latency_qos_affinity_update - Modify existing CPU affinity latency QoS.
   422	 * @pm_req : QoS request to update for CPUs with affinity masks.
   423	 * @new_value: New requested constraint value.
   424	 *
   425	 * Use @new_value to update the QoS request represented by @pm_req in the CPU
   426	 * latency QoS list along with updating the effective constraint value for that
   427	 * list.
   428	 */
   429	int cpu_latency_qos_affinity_update(struct cpu_affinity_qos_req *pm_req,
   430					    s32 new_value)
   431	{
   432		struct cpu_affinity_qos_req *cpu_pm_req, *next;
   433		int ret = 0;
   434	
   435		if (!pm_req || new_value < 0 || list_empty(&pm_req->list)) {
   436			pr_err("%s: invalid PM Qos request value\n", __func__);
   437			return -EINVAL;
   438		}
   439	
   440		list_for_each_entry_safe(cpu_pm_req, next, &pm_req->list, list) {
   441			ret = dev_pm_qos_update_request(&cpu_pm_req->req, new_value);
   442			if (ret < 0) {
   443				pr_err("PM QoS qos update failed for %s\n",
   444				       dev_name(cpu_pm_req->req.dev));
   445			} else if (ret > 0) {
   446				wakeup_qos_affinity_idle_cpu(cpu_pm_req->req.dev->id);
   447			}
   448		}
   449	
   450		return ret;
   451	}
   452	EXPORT_SYMBOL_GPL(cpu_latency_qos_affinity_update);
   453	
   454	/**
   455	 * cpu_latency_qos_affinity_remove - Remove existing CPU affinity latency QoS.
   456	 * @pm_req: QoS request to update for CPUs with affinity masks.
   457	 *
   458	 * Remove the CPU latency QoS request represented by @pm_req from the CPU latency
   459	 * QoS list.
   460	 */
   461	int cpu_latency_qos_affinity_remove(struct cpu_affinity_qos_req *pm_req)
   462	{
   463		if (!pm_req || list_empty(&pm_req->list)) {
   464			pr_err("%s: invalid PM Qos request value\n", __func__);
   465			return -EINVAL;
   466		}
   467	
   468		return cpu_latency_qos_affinity_release(&pm_req->list);
   469	}
   470	EXPORT_SYMBOL_GPL(cpu_latency_qos_affinity_remove);
   471	
   472	/**
   473	 * cpu_latency_qos_affinity_release - Release pm_reqs latency QoS resource.
   474	 * @pm_req: QoS request to remove.
   475	 *
   476	 * Release pm_reqs managed CPU affinity latency QoS resource.
   477	 */
   478	int cpu_latency_qos_affinity_release(struct list_head *pm_reqs)
 > 479	{
   480		int ret = 0;
   481		struct cpu_affinity_qos_req *cpu_pm_req, *next;
   482	
   483		list_for_each_entry_safe(cpu_pm_req, next, pm_reqs, list) {
   484			ret = dev_pm_qos_remove_request(&cpu_pm_req->req);
   485			if (ret < 0)
   486				pr_err("failed to remove qos request for %s\n",
   487				       dev_name(cpu_pm_req->req.dev));
   488			list_del(&cpu_pm_req->list);
   489			kfree(cpu_pm_req);
   490		}
   491	
   492		return ret;
   493	}
   494	#endif /* CONFIG_PM */
   495	

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

  parent reply	other threads:[~2025-04-25 10:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24  9:52 [PATCH] PM: QoS: Add support for CPU affinity mask-based CPUs latency QoS Zhongqiu Han
2025-04-24 10:25 ` Christian Loehle
2025-04-25 11:20   ` Zhongqiu Han
2025-04-25 10:17 ` kernel test robot [this message]
2025-04-25 11:10 ` kernel test robot
2025-04-25 11:10 ` kernel test robot

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=202504251805.5dAJMVbD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pavel@kernel.org \
    --cc=quic_zhonhan@quicinc.com \
    --cc=rafael@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox