All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jianlin Lv <iecedge@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH  bpf-next 1/2] Enhance BPF execution timing by excluding IRQ time
Date: Wed, 23 Apr 2025 13:31:42 +0800	[thread overview]
Message-ID: <202504231319.Ruutd2WV-lkp@intel.com> (raw)
In-Reply-To: <73fdbbf9aafd3e24e12bb58f89c70959fb3a37f1.1745250534.git.iecedge@gmail.com>

Hi Jianlin,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Jianlin-Lv/Enhance-BPF-execution-timing-by-excluding-IRQ-time/20250422-214957
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/73fdbbf9aafd3e24e12bb58f89c70959fb3a37f1.1745250534.git.iecedge%40gmail.com
patch subject: [RFC PATCH  bpf-next 1/2] Enhance BPF execution timing by excluding IRQ time
config: i386-buildonly-randconfig-001-20250423 (https://download.01.org/0day-ci/archive/20250423/202504231319.Ruutd2WV-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/20250423/202504231319.Ruutd2WV-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/202504231319.Ruutd2WV-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from kernel/kallsyms.c:25:
   include/linux/filter.h: In function '__bpf_prog_run':
>> include/linux/filter.h:708:30: warning: unused variable 'cpu' [-Wunused-variable]
     708 |                 unsigned int cpu;
         |                              ^~~
>> include/linux/filter.h:706:60: warning: unused variable 'irq_delta' [-Wunused-variable]
     706 |                 u64 duration, start, start_time, end_time, irq_delta;
         |                                                            ^~~~~~~~~
>> include/linux/filter.h:706:50: warning: unused variable 'end_time' [-Wunused-variable]
     706 |                 u64 duration, start, start_time, end_time, irq_delta;
         |                                                  ^~~~~~~~
>> include/linux/filter.h:706:38: warning: unused variable 'start_time' [-Wunused-variable]
     706 |                 u64 duration, start, start_time, end_time, irq_delta;
         |                                      ^~~~~~~~~~
   At top level:
   cc1: note: unrecognized command-line option '-Wno-unterminated-string-initialization' may have been intended to silence earlier diagnostics


vim +/cpu +708 include/linux/filter.h

   686	
   687	extern struct mutex nf_conn_btf_access_lock;
   688	extern int (*nfct_btf_struct_access)(struct bpf_verifier_log *log,
   689					     const struct bpf_reg_state *reg,
   690					     int off, int size);
   691	
   692	typedef unsigned int (*bpf_dispatcher_fn)(const void *ctx,
   693						  const struct bpf_insn *insnsi,
   694						  unsigned int (*bpf_func)(const void *,
   695									   const struct bpf_insn *));
   696	
   697	static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog,
   698						  const void *ctx,
   699						  bpf_dispatcher_fn dfunc)
   700	{
   701		u32 ret;
   702	
   703		cant_migrate();
   704		if (static_branch_unlikely(&bpf_stats_enabled_key)) {
   705			struct bpf_prog_stats *stats;
 > 706			u64 duration, start, start_time, end_time, irq_delta;
   707			unsigned long flags;
 > 708			unsigned int cpu;
   709	
   710			#ifdef CONFIG_IRQ_TIME_ACCOUNTING
   711			if (in_task()) {
   712				cpu = get_cpu();
   713				put_cpu();
   714				start_time = irq_time_read(cpu);
   715			}
   716			#endif
   717	
   718			start = sched_clock();
   719			ret = dfunc(ctx, prog->insnsi, prog->bpf_func);
   720			duration = sched_clock() - start;
   721	
   722			#ifdef CONFIG_IRQ_TIME_ACCOUNTING
   723			if (in_task()) {
   724				end_time = irq_time_read(cpu);
   725				if (end_time > start_time) {
   726					irq_delta = end_time - start_time;
   727					duration -= irq_delta;
   728				}
   729			}
   730			#endif
   731	
   732			stats = this_cpu_ptr(prog->stats);
   733			flags = u64_stats_update_begin_irqsave(&stats->syncp);
   734			u64_stats_inc(&stats->cnt);
   735			u64_stats_add(&stats->nsecs, duration);
   736			u64_stats_update_end_irqrestore(&stats->syncp, flags);
   737		} else {
   738			ret = dfunc(ctx, prog->insnsi, prog->bpf_func);
   739		}
   740		return ret;
   741	}
   742	

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

  parent reply	other threads:[~2025-04-23  5:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 13:47 [RFC PATCH bpf-next 0/2] Eliminate IRQ Time from BPF Program Running Duration Jianlin Lv
2025-04-22 13:47 ` [RFC PATCH bpf-next 1/2] Enhance BPF execution timing by excluding IRQ time Jianlin Lv
2025-04-22 14:23   ` Peter Zijlstra
2025-04-22 17:28   ` Alexei Starovoitov
2025-04-23  5:31   ` kernel test robot [this message]
2025-04-22 13:47 ` [RFC PATCH bpf-next 2/2] Export irq_time_read for BPF module usage Jianlin Lv
2025-04-22 14:24   ` Peter Zijlstra

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=202504231319.Ruutd2WV-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=iecedge@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.