All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 1474/4083] kernel/bpf/memalloc.c:387 check_free_by_rcu() error: uninitialized symbol 'flags'.
@ 2023-07-24 20:19 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-07-24 20:19 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Alexei Starovoitov <ast@kernel.org>
CC: Daniel Borkmann <daniel@iogearbox.net>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   4d2c646ac07cf4a35ef1c4a935a1a4fd6c6b1a36
commit: 5af6807bdb10d1af9d412d7d6c177ba8440adffb [1474/4083] bpf: Introduce bpf_mem_free_rcu() similar to kfree_rcu().
:::::: branch date: 16 hours ago
:::::: commit date: 12 days ago
config: x86_64-randconfig-m001-20230723 (https://download.01.org/0day-ci/archive/20230725/202307250409.bLWpbSqq-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230725/202307250409.bLWpbSqq-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202307250409.bLWpbSqq-lkp@intel.com/

smatch warnings:
kernel/bpf/memalloc.c:387 check_free_by_rcu() error: uninitialized symbol 'flags'.

vim +/flags +387 kernel/bpf/memalloc.c

5af6807bdb10d1 Alexei Starovoitov 2023-07-05  375  
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  376  static void check_free_by_rcu(struct bpf_mem_cache *c)
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  377  {
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  378  	struct llist_node *llnode, *t;
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  379  	unsigned long flags;
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  380  
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  381  	/* drain free_llist_extra_rcu */
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  382  	if (unlikely(!llist_empty(&c->free_llist_extra_rcu))) {
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  383  		inc_active(c, &flags);
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  384  		llist_for_each_safe(llnode, t, llist_del_all(&c->free_llist_extra_rcu))
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  385  			if (__llist_add(llnode, &c->free_by_rcu))
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  386  				c->free_by_rcu_tail = llnode;
5af6807bdb10d1 Alexei Starovoitov 2023-07-05 @387  		dec_active(c, flags);
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  388  	}
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  389  
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  390  	if (llist_empty(&c->free_by_rcu))
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  391  		return;
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  392  
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  393  	if (atomic_xchg(&c->call_rcu_in_progress, 1)) {
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  394  		/*
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  395  		 * Instead of kmalloc-ing new rcu_head and triggering 10k
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  396  		 * call_rcu() to hit rcutree.qhimark and force RCU to notice
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  397  		 * the overload just ask RCU to hurry up. There could be many
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  398  		 * objects in free_by_rcu list.
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  399  		 * This hint reduces memory consumption for an artificial
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  400  		 * benchmark from 2 Gbyte to 150 Mbyte.
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  401  		 */
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  402  		rcu_request_urgent_qs_task(current);
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  403  		return;
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  404  	}
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  405  
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  406  	WARN_ON_ONCE(!llist_empty(&c->waiting_for_gp));
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  407  
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  408  	inc_active(c, &flags);
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  409  	WRITE_ONCE(c->waiting_for_gp.first, __llist_del_all(&c->free_by_rcu));
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  410  	c->waiting_for_gp_tail = c->free_by_rcu_tail;
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  411  	dec_active(c, flags);
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  412  
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  413  	if (unlikely(READ_ONCE(c->draining))) {
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  414  		free_all(llist_del_all(&c->waiting_for_gp), !!c->percpu_size);
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  415  		atomic_set(&c->call_rcu_in_progress, 0);
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  416  	} else {
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  417  		call_rcu_hurry(&c->rcu, __free_by_rcu);
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  418  	}
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  419  }
5af6807bdb10d1 Alexei Starovoitov 2023-07-05  420  

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-24 20:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-24 20:19 [linux-next:master 1474/4083] kernel/bpf/memalloc.c:387 check_free_by_rcu() error: uninitialized symbol 'flags' 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.