All of lore.kernel.org
 help / color / mirror / Atom feed
* Problems running DAMON kunit tests with spinlock debugging enabled
@ 2024-09-03 19:23 Guenter Roeck
  2024-09-04  1:00 ` SeongJae Park
  0 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2024-09-03 19:23 UTC (permalink / raw)
  To: SeongJae Park; +Cc: damon

Hi,

when trying to run DAMON kunit tests with spinlock debugging enabled,
I get the following error messages.

    BUG: spinlock bad magic on CPU#0, kunit_try_catch/209
     lock: mm.13+0x40/0x840, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
    CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G                 N 6.11.0-rc6-00148-g178297ec52d6 #1
    Tainted: [N]=TEST
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
    Call Trace:
     <TASK>
     dump_stack_lvl+0x9e/0xe0
     do_raw_spin_lock+0x63/0xb0
     damon_test_three_regions_in_vmas+0x121/0x450S
     ...

This happens because damon_test_three_regions_in_vmas() calls
mt_init_flags() with MM_MT_FLAGS, which sets MT_FLAGS_LOCK_EXTERN.
Because of this, the spinlock is not initialized, which then results
in the error message when mas_lock() is called during the test.

Unfortunately, replacing MM_MT_FLAGS with MT_FLAGS_ALLOC_RANGE |
MT_FLAGS_USE_RCU or just with MT_FLAGS_ALLOC_RANGE doesn't help;
it results in various "suspicious RCU usage" messages.

At this point I gave up trying to fix the problem.

The problem should be easy to reproduce by enabling CONFIG_DEBUG_SPINLOCK
and CONFIG_LOCKDEP.

Please let me know if there is anything I can do to help fix the problem.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-09-05 18:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 19:23 Problems running DAMON kunit tests with spinlock debugging enabled Guenter Roeck
2024-09-04  1:00 ` SeongJae Park
2024-09-04  2:24   ` Guenter Roeck
2024-09-04  2:46     ` Guenter Roeck
2024-09-04 17:53       ` SeongJae Park
2024-09-04 19:06         ` Guenter Roeck
2024-09-05 16:30           ` SeongJae Park
2024-09-04 21:04         ` Guenter Roeck
2024-09-05 17:35           ` SeongJae Park
2024-09-05 18:04             ` Guenter Roeck
2024-09-05 18:08               ` SeongJae Park
2024-09-05  6:14         ` SeongJae Park

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.