All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Roman Gushchin <roman.gushchin@linux.dev>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [rgushchin:kmem_performance.1 4/7] mm/memcontrol.c:3016:17: sparse: sparse: Using plain integer as NULL pointer
Date: Sun, 1 Oct 2023 13:46:01 +0800	[thread overview]
Message-ID: <202310011333.iSgIn8LO-lkp@intel.com> (raw)

tree:   https://github.com/rgushchin/linux.git kmem_performance.1
head:   4ce474b7270a507dd448b335168acb30e9fe7d46
commit: 1b638f41428889e8e7ab15b64939d9ceeeabfbd5 [4/7] mm: kmem: add direct objcg pointer to task_struct
config: x86_64-randconfig-123-20230930 (https://download.01.org/0day-ci/archive/20231001/202310011333.iSgIn8LO-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/20231001/202310011333.iSgIn8LO-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/202310011333.iSgIn8LO-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> mm/memcontrol.c:3016:17: sparse: sparse: Using plain integer as NULL pointer
   mm/memcontrol.c:3032:23: sparse: sparse: Using plain integer as NULL pointer
   mm/memcontrol.c:4242:21: sparse: sparse: incompatible types in comparison expression (different address spaces):
   mm/memcontrol.c:4242:21: sparse:    struct mem_cgroup_threshold_ary [noderef] __rcu *
   mm/memcontrol.c:4242:21: sparse:    struct mem_cgroup_threshold_ary *
   mm/memcontrol.c:4244:21: sparse: sparse: incompatible types in comparison expression (different address spaces):
   mm/memcontrol.c:4244:21: sparse:    struct mem_cgroup_threshold_ary [noderef] __rcu *
   mm/memcontrol.c:4244:21: sparse:    struct mem_cgroup_threshold_ary *
   mm/memcontrol.c:4400:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   mm/memcontrol.c:4400:9: sparse:    struct mem_cgroup_threshold_ary [noderef] __rcu *
   mm/memcontrol.c:4400:9: sparse:    struct mem_cgroup_threshold_ary *
   mm/memcontrol.c:4494:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   mm/memcontrol.c:4494:9: sparse:    struct mem_cgroup_threshold_ary [noderef] __rcu *
   mm/memcontrol.c:4494:9: sparse:    struct mem_cgroup_threshold_ary *
   mm/memcontrol.c:6206:23: sparse: sparse: incompatible types in comparison expression (different address spaces):
   mm/memcontrol.c:6206:23: sparse:    struct task_struct [noderef] __rcu *
   mm/memcontrol.c:6206:23: sparse:    struct task_struct *
   mm/memcontrol.c:6443:52: sparse: sparse: incompatible types in comparison expression (different address spaces):
   mm/memcontrol.c:6443:52: sparse:    struct task_struct [noderef] __rcu *
   mm/memcontrol.c:6443:52: sparse:    struct task_struct *
   mm/memcontrol.c: note: in included file:
   include/linux/memcontrol.h:761:9: sparse: sparse: context imbalance in 'folio_lruvec_lock' - wrong count at exit
   include/linux/memcontrol.h:761:9: sparse: sparse: context imbalance in 'folio_lruvec_lock_irq' - wrong count at exit
   include/linux/memcontrol.h:761:9: sparse: sparse: context imbalance in 'folio_lruvec_lock_irqsave' - wrong count at exit
   mm/memcontrol.c:2095:6: sparse: sparse: context imbalance in 'folio_memcg_lock' - wrong count at exit
   mm/memcontrol.c:2142:17: sparse: sparse: context imbalance in '__folio_memcg_unlock' - unexpected unlock
   mm/memcontrol.c:6056:28: sparse: sparse: context imbalance in 'mem_cgroup_count_precharge_pte_range' - unexpected unlock
   mm/memcontrol.c:6251:36: sparse: sparse: context imbalance in 'mem_cgroup_move_charge_pte_range' - unexpected unlock

vim +3016 mm/memcontrol.c

  3003	
  3004	static struct obj_cgroup *current_objcg_update(struct obj_cgroup *old)
  3005	{
  3006		struct mem_cgroup *memcg;
  3007		struct obj_cgroup *objcg = NULL, *tmp = old;
  3008	
  3009		old = current_objcg_without_update_flag(old);
  3010		if (old)
  3011			obj_cgroup_put(old);
  3012	
  3013		rcu_read_lock();
  3014		do {
  3015			/* Atomically drop the update bit, */
> 3016			WARN_ON_ONCE(cmpxchg(&current->objcg, tmp, 0) != tmp);
  3017	
  3018			/* ...obtain the new objcg pointer */
  3019			memcg = mem_cgroup_from_task(current);
  3020			for (; memcg != root_mem_cgroup; memcg = parent_mem_cgroup(memcg)) {
  3021				objcg = rcu_dereference(memcg->objcg);
  3022				if (objcg && obj_cgroup_tryget(objcg))
  3023					break;
  3024				objcg = NULL;
  3025			}
  3026	
  3027			/*
  3028			 * ...and try atomically set up a new objcg pointer. If it
  3029			 * fails, it means the update flag was set concurrently, so
  3030			 * the whole procedure should be repeated.
  3031			 */
  3032			tmp = 0;
  3033		} while (!try_cmpxchg(&current->objcg, &tmp, objcg));
  3034		rcu_read_unlock();
  3035	
  3036		return objcg;
  3037	}
  3038	

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

             reply	other threads:[~2023-10-01  5:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-01  5:46 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-11 15:59 [rgushchin:kmem_performance.1 4/7] mm/memcontrol.c:3016:17: sparse: sparse: Using plain integer as NULL pointer 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=202310011333.iSgIn8LO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=roman.gushchin@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.