From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [peterz-queue:locking/ww_rt_mutex 4/18] lib/test_lockup.c:505:10: error: no member named 'rlock' in 'raw_spinlock'
Date: Fri, 30 Jul 2021 15:00:47 +0800 [thread overview]
Message-ID: <202107301521.siXALSEA-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 16791 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/ww_rt_mutex
head: 513277f3c78127286fd37a34f616801bdcc3aa60
commit: 6b1fb4c05b188aedc0ef03087d0f48a912aa2761 [4/18] locking/mutex: Make mutex::wait_lock raw
config: x86_64-randconfig-a005-20210730 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c49df15c278857adecd12db6bb1cdc96885f7079)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=6b1fb4c05b188aedc0ef03087d0f48a912aa2761
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue locking/ww_rt_mutex
git checkout 6b1fb4c05b188aedc0ef03087d0f48a912aa2761
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=x86_64 SHELL=/bin/bash lib/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> lib/test_lockup.c:505:10: error: no member named 'rlock' in 'raw_spinlock'
offsetof(struct mutex, wait_lock.rlock.magic),
^ ~~~~~~
include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^ ~~~~~~
include/linux/compiler_types.h:140:35: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^ ~
1 error generated.
vim +505 lib/test_lockup.c
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 448
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 449 static int __init test_lockup_init(void)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 450 {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 451 u64 test_start = local_clock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 452
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 453 main_task = current;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 454
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 455 switch (state[0]) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 456 case 'S':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 457 wait_state = TASK_INTERRUPTIBLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 458 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 459 case 'D':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 460 wait_state = TASK_UNINTERRUPTIBLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 461 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 462 case 'K':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 463 wait_state = TASK_KILLABLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 464 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 465 case 'R':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 466 wait_state = TASK_RUNNING;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 467 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 468 default:
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 469 pr_err("unknown state=%s\n", state);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 470 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 471 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 472
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 473 if (alloc_pages_atomic)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 474 alloc_pages_gfp = GFP_ATOMIC;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 475
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 476 if (test_kernel_ptr(lock_spinlock_ptr, sizeof(spinlock_t)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 477 test_kernel_ptr(lock_rwlock_ptr, sizeof(rwlock_t)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 478 test_kernel_ptr(lock_mutex_ptr, sizeof(struct mutex)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 479 test_kernel_ptr(lock_rwsem_ptr, sizeof(struct rw_semaphore)))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 480 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 481
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 482 #ifdef CONFIG_DEBUG_SPINLOCK
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 483 #ifdef CONFIG_PREEMPT_RT
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 484 if (test_magic(lock_spinlock_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 485 offsetof(spinlock_t, lock.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 486 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 487 test_magic(lock_rwlock_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 488 offsetof(rwlock_t, rtmutex.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 489 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 490 test_magic(lock_mutex_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 491 offsetof(struct mutex, lock.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 492 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 493 test_magic(lock_rwsem_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 494 offsetof(struct rw_semaphore, rtmutex.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 495 SPINLOCK_MAGIC))
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 496 return -EINVAL;
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 497 #else
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 498 if (test_magic(lock_spinlock_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 499 offsetof(spinlock_t, rlock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 500 SPINLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 501 test_magic(lock_rwlock_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 502 offsetof(rwlock_t, magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 503 RWLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 504 test_magic(lock_mutex_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 @505 offsetof(struct mutex, wait_lock.rlock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 506 SPINLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 507 test_magic(lock_rwsem_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 508 offsetof(struct rw_semaphore, wait_lock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 509 SPINLOCK_MAGIC))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 510 return -EINVAL;
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 511 #endif
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 512 #endif
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 513
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 514 if ((wait_state != TASK_RUNNING ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 515 (call_cond_resched && !reacquire_locks) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 516 (alloc_pages_nr && gfpflags_allow_blocking(alloc_pages_gfp))) &&
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 517 (test_disable_irq || disable_softirq || disable_preempt ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 518 lock_rcu || lock_spinlock_ptr || lock_rwlock_ptr)) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 519 pr_err("refuse to sleep in atomic context\n");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 520 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 521 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 522
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 523 if (lock_mmap_sem && !main_task->mm) {
c1e8d7c6a7a682 Michel Lespinasse 2020-06-08 524 pr_err("no mm to lock mmap_lock\n");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 525 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 526 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 527
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 528 if (test_file_path[0]) {
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 529 test_file = filp_open(test_file_path, O_RDONLY, 0);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 530 if (IS_ERR(test_file)) {
3adf3bae0d6123 Tiezhu Yang 2020-08-11 531 pr_err("failed to open %s: %ld\n", test_file_path, PTR_ERR(test_file));
3adf3bae0d6123 Tiezhu Yang 2020-08-11 532 return PTR_ERR(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 533 }
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 534 test_inode = file_inode(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 535 } else if (test_lock_inode ||
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 536 test_lock_mapping ||
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 537 test_lock_sb_umount) {
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 538 pr_err("no file to lock\n");
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 539 return -EINVAL;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 540 }
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 541
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 542 if (test_lock_inode && test_inode)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 543 lock_rwsem_ptr = (unsigned long)&test_inode->i_rwsem;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 544
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 545 if (test_lock_mapping && test_file && test_file->f_mapping)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 546 lock_rwsem_ptr = (unsigned long)&test_file->f_mapping->i_mmap_rwsem;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 547
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 548 if (test_lock_sb_umount && test_inode)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 549 lock_rwsem_ptr = (unsigned long)&test_inode->i_sb->s_umount;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 550
ad3f434b87e7d2 Colin Ian King 2020-04-06 551 pr_notice("START pid=%d time=%u +%u ns cooldown=%u +%u ns iterations=%u state=%s %s%s%s%s%s%s%s%s%s%s%s\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 552 main_task->pid, time_secs, time_nsecs,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 553 cooldown_secs, cooldown_nsecs, iterations, state,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 554 all_cpus ? "all_cpus " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 555 iowait ? "iowait " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 556 test_disable_irq ? "disable_irq " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 557 disable_softirq ? "disable_softirq " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 558 disable_preempt ? "disable_preempt " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 559 lock_rcu ? "lock_rcu " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 560 lock_read ? "lock_read " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 561 touch_softlockup ? "touch_softlockup " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 562 touch_hardlockup ? "touch_hardlockup " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 563 call_cond_resched ? "call_cond_resched " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 564 reacquire_locks ? "reacquire_locks " : "");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 565
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 566 if (alloc_pages_nr)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 567 pr_notice("ALLOCATE PAGES nr=%u order=%u gfp=%pGg %s\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 568 alloc_pages_nr, alloc_pages_order, &alloc_pages_gfp,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 569 reallocate_pages ? "reallocate_pages " : "");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 570
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 571 if (all_cpus) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 572 unsigned int cpu;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 573
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 574 cpus_read_lock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 575
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 576 preempt_disable();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 577 master_cpu = smp_processor_id();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 578 for_each_online_cpu(cpu) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 579 INIT_WORK(per_cpu_ptr(&test_works, cpu), test_work_fn);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 580 queue_work_on(cpu, system_highpri_wq,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 581 per_cpu_ptr(&test_works, cpu));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 582 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 583 preempt_enable();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 584
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 585 for_each_online_cpu(cpu)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 586 flush_work(per_cpu_ptr(&test_works, cpu));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 587
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 588 cpus_read_unlock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 589 } else {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 590 test_lockup(true);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 591 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 592
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 593 if (measure_lock_wait)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 594 pr_notice("Maximum lock wait: %lld ns\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 595 atomic64_read(&max_lock_wait));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 596
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 597 if (alloc_pages_nr)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 598 pr_notice("Page allocation failed %u times\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 599 atomic_read(&alloc_pages_failed));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 600
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 601 pr_notice("FINISH in %llu ns\n", local_clock() - test_start);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 602
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 603 if (test_file)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 604 fput(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 605
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 606 if (signal_pending(main_task))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 607 return -EINTR;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 608
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 609 return -EAGAIN;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 610 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 611 module_init(test_lockup_init);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 612
:::::: The code at line 505 was first introduced by commit
:::::: 30428ef5d1e8caf78639cc70a802f1cb7b1cec04 lib/test_lockup: test module to generate lockups
:::::: TO: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31623 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>
Subject: [peterz-queue:locking/ww_rt_mutex 4/18] lib/test_lockup.c:505:10: error: no member named 'rlock' in 'raw_spinlock'
Date: Fri, 30 Jul 2021 15:00:47 +0800 [thread overview]
Message-ID: <202107301521.siXALSEA-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 16579 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/ww_rt_mutex
head: 513277f3c78127286fd37a34f616801bdcc3aa60
commit: 6b1fb4c05b188aedc0ef03087d0f48a912aa2761 [4/18] locking/mutex: Make mutex::wait_lock raw
config: x86_64-randconfig-a005-20210730 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c49df15c278857adecd12db6bb1cdc96885f7079)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=6b1fb4c05b188aedc0ef03087d0f48a912aa2761
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue locking/ww_rt_mutex
git checkout 6b1fb4c05b188aedc0ef03087d0f48a912aa2761
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=x86_64 SHELL=/bin/bash lib/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> lib/test_lockup.c:505:10: error: no member named 'rlock' in 'raw_spinlock'
offsetof(struct mutex, wait_lock.rlock.magic),
^ ~~~~~~
include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^ ~~~~~~
include/linux/compiler_types.h:140:35: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^ ~
1 error generated.
vim +505 lib/test_lockup.c
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 448
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 449 static int __init test_lockup_init(void)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 450 {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 451 u64 test_start = local_clock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 452
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 453 main_task = current;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 454
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 455 switch (state[0]) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 456 case 'S':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 457 wait_state = TASK_INTERRUPTIBLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 458 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 459 case 'D':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 460 wait_state = TASK_UNINTERRUPTIBLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 461 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 462 case 'K':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 463 wait_state = TASK_KILLABLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 464 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 465 case 'R':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 466 wait_state = TASK_RUNNING;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 467 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 468 default:
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 469 pr_err("unknown state=%s\n", state);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 470 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 471 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 472
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 473 if (alloc_pages_atomic)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 474 alloc_pages_gfp = GFP_ATOMIC;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 475
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 476 if (test_kernel_ptr(lock_spinlock_ptr, sizeof(spinlock_t)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 477 test_kernel_ptr(lock_rwlock_ptr, sizeof(rwlock_t)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 478 test_kernel_ptr(lock_mutex_ptr, sizeof(struct mutex)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 479 test_kernel_ptr(lock_rwsem_ptr, sizeof(struct rw_semaphore)))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 480 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 481
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 482 #ifdef CONFIG_DEBUG_SPINLOCK
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 483 #ifdef CONFIG_PREEMPT_RT
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 484 if (test_magic(lock_spinlock_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 485 offsetof(spinlock_t, lock.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 486 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 487 test_magic(lock_rwlock_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 488 offsetof(rwlock_t, rtmutex.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 489 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 490 test_magic(lock_mutex_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 491 offsetof(struct mutex, lock.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 492 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 493 test_magic(lock_rwsem_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 494 offsetof(struct rw_semaphore, rtmutex.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 495 SPINLOCK_MAGIC))
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 496 return -EINVAL;
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 497 #else
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 498 if (test_magic(lock_spinlock_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 499 offsetof(spinlock_t, rlock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 500 SPINLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 501 test_magic(lock_rwlock_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 502 offsetof(rwlock_t, magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 503 RWLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 504 test_magic(lock_mutex_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 @505 offsetof(struct mutex, wait_lock.rlock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 506 SPINLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 507 test_magic(lock_rwsem_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 508 offsetof(struct rw_semaphore, wait_lock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 509 SPINLOCK_MAGIC))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 510 return -EINVAL;
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 511 #endif
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 512 #endif
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 513
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 514 if ((wait_state != TASK_RUNNING ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 515 (call_cond_resched && !reacquire_locks) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 516 (alloc_pages_nr && gfpflags_allow_blocking(alloc_pages_gfp))) &&
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 517 (test_disable_irq || disable_softirq || disable_preempt ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 518 lock_rcu || lock_spinlock_ptr || lock_rwlock_ptr)) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 519 pr_err("refuse to sleep in atomic context\n");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 520 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 521 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 522
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 523 if (lock_mmap_sem && !main_task->mm) {
c1e8d7c6a7a682 Michel Lespinasse 2020-06-08 524 pr_err("no mm to lock mmap_lock\n");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 525 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 526 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 527
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 528 if (test_file_path[0]) {
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 529 test_file = filp_open(test_file_path, O_RDONLY, 0);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 530 if (IS_ERR(test_file)) {
3adf3bae0d6123 Tiezhu Yang 2020-08-11 531 pr_err("failed to open %s: %ld\n", test_file_path, PTR_ERR(test_file));
3adf3bae0d6123 Tiezhu Yang 2020-08-11 532 return PTR_ERR(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 533 }
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 534 test_inode = file_inode(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 535 } else if (test_lock_inode ||
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 536 test_lock_mapping ||
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 537 test_lock_sb_umount) {
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 538 pr_err("no file to lock\n");
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 539 return -EINVAL;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 540 }
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 541
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 542 if (test_lock_inode && test_inode)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 543 lock_rwsem_ptr = (unsigned long)&test_inode->i_rwsem;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 544
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 545 if (test_lock_mapping && test_file && test_file->f_mapping)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 546 lock_rwsem_ptr = (unsigned long)&test_file->f_mapping->i_mmap_rwsem;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 547
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 548 if (test_lock_sb_umount && test_inode)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 549 lock_rwsem_ptr = (unsigned long)&test_inode->i_sb->s_umount;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 550
ad3f434b87e7d2 Colin Ian King 2020-04-06 551 pr_notice("START pid=%d time=%u +%u ns cooldown=%u +%u ns iterations=%u state=%s %s%s%s%s%s%s%s%s%s%s%s\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 552 main_task->pid, time_secs, time_nsecs,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 553 cooldown_secs, cooldown_nsecs, iterations, state,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 554 all_cpus ? "all_cpus " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 555 iowait ? "iowait " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 556 test_disable_irq ? "disable_irq " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 557 disable_softirq ? "disable_softirq " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 558 disable_preempt ? "disable_preempt " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 559 lock_rcu ? "lock_rcu " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 560 lock_read ? "lock_read " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 561 touch_softlockup ? "touch_softlockup " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 562 touch_hardlockup ? "touch_hardlockup " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 563 call_cond_resched ? "call_cond_resched " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 564 reacquire_locks ? "reacquire_locks " : "");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 565
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 566 if (alloc_pages_nr)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 567 pr_notice("ALLOCATE PAGES nr=%u order=%u gfp=%pGg %s\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 568 alloc_pages_nr, alloc_pages_order, &alloc_pages_gfp,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 569 reallocate_pages ? "reallocate_pages " : "");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 570
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 571 if (all_cpus) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 572 unsigned int cpu;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 573
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 574 cpus_read_lock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 575
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 576 preempt_disable();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 577 master_cpu = smp_processor_id();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 578 for_each_online_cpu(cpu) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 579 INIT_WORK(per_cpu_ptr(&test_works, cpu), test_work_fn);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 580 queue_work_on(cpu, system_highpri_wq,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 581 per_cpu_ptr(&test_works, cpu));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 582 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 583 preempt_enable();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 584
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 585 for_each_online_cpu(cpu)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 586 flush_work(per_cpu_ptr(&test_works, cpu));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 587
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 588 cpus_read_unlock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 589 } else {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 590 test_lockup(true);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 591 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 592
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 593 if (measure_lock_wait)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 594 pr_notice("Maximum lock wait: %lld ns\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 595 atomic64_read(&max_lock_wait));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 596
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 597 if (alloc_pages_nr)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 598 pr_notice("Page allocation failed %u times\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 599 atomic_read(&alloc_pages_failed));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 600
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 601 pr_notice("FINISH in %llu ns\n", local_clock() - test_start);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 602
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 603 if (test_file)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 604 fput(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 605
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 606 if (signal_pending(main_task))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 607 return -EINTR;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 608
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 609 return -EAGAIN;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 610 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 611 module_init(test_lockup_init);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 612
:::::: The code at line 505 was first introduced by commit
:::::: 30428ef5d1e8caf78639cc70a802f1cb7b1cec04 lib/test_lockup: test module to generate lockups
:::::: TO: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31623 bytes --]
next reply other threads:[~2021-07-30 7:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-30 7:00 kernel test robot [this message]
2021-07-30 7:00 ` [peterz-queue:locking/ww_rt_mutex 4/18] lib/test_lockup.c:505:10: error: no member named 'rlock' in 'raw_spinlock' 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=202107301521.siXALSEA-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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.