From: kernel test robot <lkp@intel.com>
To: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC 4/6] percpu-refcount-torture: Extend test with runtime mode switches
Date: Thu, 19 Sep 2024 10:11:53 +0800 [thread overview]
Message-ID: <202409190905.Cy8vmSdT-lkp@intel.com> (raw)
In-Reply-To: <20240916050811.473556-5-Neeraj.Upadhyay@amd.com>
Hi Neeraj,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-nonmm-unstable]
[also build test WARNING on linus/master dennis-percpu/for-next v6.11 next-20240918]
[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/Neeraj-Upadhyay/percpu-refcount-Add-managed-mode-for-RCU-released-objects/20240916-131210
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
patch link: https://lore.kernel.org/r/20240916050811.473556-5-Neeraj.Upadhyay%40amd.com
patch subject: [RFC 4/6] percpu-refcount-torture: Extend test with runtime mode switches
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20240919/202409190905.Cy8vmSdT-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/20240919/202409190905.Cy8vmSdT-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/202409190905.Cy8vmSdT-lkp@intel.com/
All warnings (new ones prefixed by >>):
lib/percpu-refcount-torture.c: In function 'percpu_ref_test_cleanup':
lib/percpu-refcount-torture.c:206:17: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration]
206 | kfree(busted_late_release_tasks);
| ^~~~~
lib/percpu-refcount-torture.c: In function 'percpu_ref_torture_init':
lib/percpu-refcount-torture.c:273:16: error: implicit declaration of function 'kcalloc' [-Werror=implicit-function-declaration]
273 | refs = kcalloc(nrefs, sizeof(refs[0]), GFP_KERNEL);
| ^~~~~~~
lib/percpu-refcount-torture.c:273:14: warning: assignment to 'struct percpu_ref *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
273 | refs = kcalloc(nrefs, sizeof(refs[0]), GFP_KERNEL);
| ^
lib/percpu-refcount-torture.c:290:27: warning: assignment to 'long int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
290 | num_per_ref_users = kcalloc(nrefs, sizeof(num_per_ref_users[0]), GFP_KERNEL);
| ^
>> lib/percpu-refcount-torture.c:299:28: warning: assignment to 'struct mutex *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
299 | ref_switch_mutexes = kcalloc(nrefs, sizeof(ref_switch_mutexes[0]), GFP_KERNEL);
| ^
lib/percpu-refcount-torture.c:309:24: warning: assignment to 'struct task_struct **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
309 | ref_user_tasks = kcalloc(nusers, sizeof(ref_user_tasks[0]), GFP_KERNEL);
| ^
lib/percpu-refcount-torture.c:316:21: warning: assignment to 'atomic_t *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
316 | ref_running = kcalloc(nrefs, sizeof(ref_running[0]), GFP_KERNEL);
| ^
lib/percpu-refcount-torture.c:346:44: warning: assignment to 'struct task_struct **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
346 | busted_early_release_tasks = kcalloc(nrefs,
| ^
lib/percpu-refcount-torture.c:363:43: warning: assignment to 'struct task_struct **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
363 | busted_late_release_tasks = kcalloc(nrefs, sizeof(busted_late_release_tasks[0]),
| ^
cc1: some warnings being treated as errors
vim +299 lib/percpu-refcount-torture.c
256
257 static int __init percpu_ref_torture_init(void)
258 {
259 DEFINE_TORTURE_RANDOM(rand);
260 struct torture_random_state *trsp = &rand;
261 int flags;
262 int err;
263 int ref_idx;
264 int i;
265
266 if (!torture_init_begin("percpu-refcount", verbose))
267 return -EBUSY;
268
269 atomic_set(&running, nusers);
270 /* Order @running with later increment and decrement operations */
271 smp_mb();
272
> 273 refs = kcalloc(nrefs, sizeof(refs[0]), GFP_KERNEL);
274 if (!refs) {
275 TOROUT_ERRSTRING("out of memory");
276 err = -ENOMEM;
277 goto init_err;
278 }
279 for (i = 0; i < nrefs; i++) {
280 flags = (torture_random(trsp) & 1) ? PERCPU_REF_INIT_ATOMIC :
281 PERCPU_REF_REL_MANAGED;
282 err = percpu_ref_init(&refs[i], percpu_ref_test_release,
283 flags, GFP_KERNEL);
284 if (err)
285 goto init_err;
286 if (!(flags & PERCPU_REF_REL_MANAGED))
287 percpu_ref_switch_to_managed(&refs[i]);
288 }
289
290 num_per_ref_users = kcalloc(nrefs, sizeof(num_per_ref_users[0]), GFP_KERNEL);
291 if (!num_per_ref_users) {
292 TOROUT_ERRSTRING("out of memory");
293 err = -ENOMEM;
294 goto init_err;
295 }
296 for (i = 0; i < nrefs; i++)
297 num_per_ref_users[i] = 0;
298
> 299 ref_switch_mutexes = kcalloc(nrefs, sizeof(ref_switch_mutexes[0]), GFP_KERNEL);
300 if (!ref_switch_mutexes) {
301 TOROUT_ERRSTRING("out of memory");
302 err = -ENOMEM;
303 goto init_err;
304 }
305
306 for (i = 0; i < nrefs; i++)
307 mutex_init(&ref_switch_mutexes[i]);
308
309 ref_user_tasks = kcalloc(nusers, sizeof(ref_user_tasks[0]), GFP_KERNEL);
310 if (!ref_user_tasks) {
311 TOROUT_ERRSTRING("out of memory");
312 err = -ENOMEM;
313 goto init_err;
314 }
315
316 ref_running = kcalloc(nrefs, sizeof(ref_running[0]), GFP_KERNEL);
317 if (!ref_running) {
318 TOROUT_ERRSTRING("out of memory");
319 err = -ENOMEM;
320 goto init_err;
321 }
322
323 for (i = 0; i < nusers; i++) {
324 ref_idx = torture_random(trsp) % nrefs;
325 atomic_inc(&ref_running[ref_idx]);
326 num_per_ref_users[ref_idx]++;
327 /* Order increments with subquent reads */
328 smp_mb();
329 err = torture_create_kthread(percpu_ref_test_thread,
330 &refs[ref_idx], ref_user_tasks[i]);
331 if (torture_init_error(err))
332 goto init_err;
333 }
334
335 err = torture_create_kthread(percpu_ref_manager_thread, NULL, ref_manager_task);
336 if (torture_init_error(err))
337 goto init_err;
338
339 /* Drop initial reference, after test threads have started running */
340 udelay(1);
341 for (i = 0; i < nrefs; i++)
342 percpu_ref_put(&refs[i]);
343
344
345 if (busted_early_ref_release) {
346 busted_early_release_tasks = kcalloc(nrefs,
347 sizeof(busted_early_release_tasks[0]),
348 GFP_KERNEL);
349 if (!busted_early_release_tasks) {
350 TOROUT_ERRSTRING("out of memory");
351 err = -ENOMEM;
352 goto init_err;
353 }
354 for (i = 0; i < nrefs; i++) {
355 err = torture_create_kthread(percpu_ref_busted_early_thread,
356 &refs[i], busted_early_release_tasks[i]);
357 if (torture_init_error(err))
358 goto init_err;
359 }
360 }
361
362 if (busted_late_ref_release) {
363 busted_late_release_tasks = kcalloc(nrefs, sizeof(busted_late_release_tasks[0]),
364 GFP_KERNEL);
365 if (!busted_late_release_tasks) {
366 TOROUT_ERRSTRING("out of memory");
367 err = -ENOMEM;
368 goto init_err;
369 }
370 for (i = 0; i < nrefs; i++) {
371 err = torture_create_kthread(percpu_ref_busted_late_thread,
372 &refs[i], busted_late_release_tasks[i]);
373 if (torture_init_error(err))
374 goto init_err;
375 }
376 }
377 if (stutter) {
378 err = torture_stutter_init(stutter, stutter);
379 if (torture_init_error(err))
380 goto init_err;
381 }
382
383 err = torture_onoff_init(onoff_holdoff * HZ, onoff_interval, NULL);
384 if (torture_init_error(err))
385 goto init_err;
386
387 torture_init_end();
388 return 0;
389 init_err:
390 torture_init_end();
391 percpu_ref_test_cleanup();
392 return err;
393 }
394
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-09-19 2:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 5:08 [RFC 0/6] Managed Percpu Refcount Neeraj Upadhyay
2024-09-16 5:08 ` [RFC 1/6] percpu-refcount: Add managed mode for RCU released objects Neeraj Upadhyay
2024-09-16 5:08 ` [RFC 2/6] percpu-refcount: Add torture test for percpu refcount Neeraj Upadhyay
2024-09-19 0:47 ` kernel test robot
2024-09-16 5:08 ` [RFC 3/6] percpu-refcount: Extend managed mode to allow runtime switching Neeraj Upadhyay
2024-09-16 12:04 ` kernel test robot
2024-09-16 19:07 ` kernel test robot
2024-09-16 5:08 ` [RFC 4/6] percpu-refcount-torture: Extend test with runtime mode switches Neeraj Upadhyay
2024-09-19 2:11 ` kernel test robot [this message]
2024-09-16 5:08 ` [RFC 5/6] apparmor: Switch labels to percpu refcount in atomic mode Neeraj Upadhyay
2024-09-16 5:08 ` [RFC 6/6] apparmor: Switch labels to percpu ref managed mode Neeraj Upadhyay
2024-09-18 5:44 ` 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=202409190905.Cy8vmSdT-lkp@intel.com \
--to=lkp@intel.com \
--cc=Neeraj.Upadhyay@amd.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.