Skip to content

Commit

Permalink
Linux: disable lockdep for a couple of locks
Browse files Browse the repository at this point in the history
When running a debug kernel with lockdep enabled there
are several locks which report false positives.  Set
MUTEX_NOLOCKDEP/RW_NOLOCKDEP to disable these warnings.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
  • Loading branch information
behlendorf committed May 10, 2024
1 parent 136c053 commit bd1c945
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion module/os/linux/spl/spl-procfs-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ procfs_list_install(const char *module,
modulestr = kmem_asprintf("%s/%s", module, submodule);
else
modulestr = kmem_asprintf("%s", module);
mutex_init(&procfs_list->pl_lock, NULL, MUTEX_DEFAULT, NULL);
mutex_init(&procfs_list->pl_lock, NULL, MUTEX_NOLOCKDEP, NULL);
list_create(&procfs_list->pl_list,
procfs_list_node_off + sizeof (procfs_list_node_t),
procfs_list_node_off + offsetof(procfs_list_node_t, pln_link));
Expand Down
6 changes: 3 additions & 3 deletions module/zfs/dbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ dbuf_cons(void *vdb, void *unused, int kmflag)
dmu_buf_impl_t *db = vdb;
memset(db, 0, sizeof (dmu_buf_impl_t));

mutex_init(&db->db_mtx, NULL, MUTEX_DEFAULT, NULL);
rw_init(&db->db_rwlock, NULL, RW_DEFAULT, NULL);
mutex_init(&db->db_mtx, NULL, MUTEX_NOLOCKDEP, NULL);
rw_init(&db->db_rwlock, NULL, RW_NOLOCKDEP, NULL);
cv_init(&db->db_changed, NULL, CV_DEFAULT, NULL);
multilist_link_init(&db->db_cache_link);
zfs_refcount_create(&db->db_holds);
Expand Down Expand Up @@ -958,7 +958,7 @@ dbuf_init(void)
0, dbuf_cons, dbuf_dest, NULL, NULL, NULL, 0);

for (int i = 0; i < hmsize; i++)
mutex_init(&h->hash_mutexes[i], NULL, MUTEX_DEFAULT, NULL);
mutex_init(&h->hash_mutexes[i], NULL, MUTEX_NOLOCKDEP, NULL);

dbuf_stats_init(h);

Expand Down

0 comments on commit bd1c945

Please sign in to comment.