All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [cel:simple-offset-maple 5/7] lib/test_maple_tree.c:3612 alloc_cyclic_testing() warn: sleeping in atomic context
Date: Fri, 16 Feb 2024 04:37:09 +0800	[thread overview]
Message-ID: <202402160419.2pdB2GFG-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: "Liam R. Howlett" <Liam.Howlett@oracle.com>
CC: Chuck Lever <chuck.lever@oracle.com>

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux simple-offset-maple
head:   380438ec8aea040862920a4abd295062125939fe
commit: c9d26c93c59232dcd560b8275e9c2a7f058c9a39 [5/7] test_maple_tree: testing the cyclic allocation
:::::: branch date: 4 hours ago
:::::: commit date: 2 days ago
config: i386-randconfig-141-20240214 (https://download.01.org/0day-ci/archive/20240216/202402160419.2pdB2GFG-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)

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/202402160419.2pdB2GFG-lkp@intel.com/

smatch warnings:
lib/test_maple_tree.c:3612 alloc_cyclic_testing() warn: sleeping in atomic context

vim +3612 lib/test_maple_tree.c

eb2e817f38cafb Liam R. Howlett 2023-05-18  3601  
c9d26c93c59232 Liam R. Howlett 2024-02-13  3602  static noinline void __init alloc_cyclic_testing(struct maple_tree *mt)
c9d26c93c59232 Liam R. Howlett 2024-02-13  3603  {
c9d26c93c59232 Liam R. Howlett 2024-02-13  3604  	unsigned long location;
c9d26c93c59232 Liam R. Howlett 2024-02-13  3605  	unsigned long next;
c9d26c93c59232 Liam R. Howlett 2024-02-13  3606  	int ret = 0;
c9d26c93c59232 Liam R. Howlett 2024-02-13  3607  	MA_STATE(mas, mt, 0, 0);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3608  
c9d26c93c59232 Liam R. Howlett 2024-02-13  3609  	next = 0;
c9d26c93c59232 Liam R. Howlett 2024-02-13  3610  	mtree_lock(mt);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3611  	for (int i = 0; i < 100; i++) {
c9d26c93c59232 Liam R. Howlett 2024-02-13 @3612  		mas_alloc_cyclic(&mas, &location, mt, 2, ULONG_MAX, &next, GFP_KERNEL);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3613  		MAS_BUG_ON(&mas, i != location - 2);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3614  		MAS_BUG_ON(&mas, mas.index != location);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3615  		MAS_BUG_ON(&mas, mas.last != location);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3616  		MAS_BUG_ON(&mas, i != next - 3);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3617  	}
c9d26c93c59232 Liam R. Howlett 2024-02-13  3618  
c9d26c93c59232 Liam R. Howlett 2024-02-13  3619  	mtree_unlock(mt);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3620  	mtree_destroy(mt);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3621  	next = 0;
c9d26c93c59232 Liam R. Howlett 2024-02-13  3622  	mt_init_flags(mt, MT_FLAGS_ALLOC_RANGE);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3623  	for (int i = 0; i < 100; i++) {
c9d26c93c59232 Liam R. Howlett 2024-02-13  3624  		mtree_alloc_cyclic(mt, &location, mt, 2, ULONG_MAX, &next, GFP_KERNEL);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3625  		MT_BUG_ON(mt, i != location - 2);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3626  		MT_BUG_ON(mt, i != next - 3);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3627  		MT_BUG_ON(mt, mtree_load(mt, location) != mt);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3628  	}
c9d26c93c59232 Liam R. Howlett 2024-02-13  3629  
c9d26c93c59232 Liam R. Howlett 2024-02-13  3630  	mtree_destroy(mt);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3631  	/* Overflow test */
c9d26c93c59232 Liam R. Howlett 2024-02-13  3632  	next = ULONG_MAX - 1;
c9d26c93c59232 Liam R. Howlett 2024-02-13  3633  	ret = mtree_alloc_cyclic(mt, &location, mt, 2, ULONG_MAX, &next, GFP_KERNEL);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3634  	MT_BUG_ON(mt, ret != 0);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3635  	ret = mtree_alloc_cyclic(mt, &location, mt, 2, ULONG_MAX, &next, GFP_KERNEL);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3636  	MT_BUG_ON(mt, ret != 0);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3637  	ret = mtree_alloc_cyclic(mt, &location, mt, 2, ULONG_MAX, &next, GFP_KERNEL);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3638  	MT_BUG_ON(mt, ret != 1);
c9d26c93c59232 Liam R. Howlett 2024-02-13  3639  }
c9d26c93c59232 Liam R. Howlett 2024-02-13  3640  

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

                 reply	other threads:[~2024-02-15 20:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202402160419.2pdB2GFG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@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.