Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-12509

lockdep warning in ofd_precreate_objects()

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • Lustre 2.13.0
    • None
    • None
    • 9223372036854775807

    Description

      [ 141.023079]
      ============================================
      [ 141.023750] WARNING: possible recursive locking detected
      [ 141.024443] 4.18.0-debug #8 Tainted: G O --------- - -
      [ 141.025226] --------------------------------------------
      [ 141.025967] ll_ost00_002/7298 is trying to acquire lock:
      [ 141.030372] 000000001989e622 (&mo->oo_sem){++++}, at: osd_write_lock+0x8a/0xb0 [osd_zfs]
      [ 141.031190]
      [ 141.031190] but task is already holding lock:
      [ 141.032872] 0000000086a83aaf (&mo->oo_sem){++++}, at: osd_write_lock+0x8a/0xb0 [osd_zfs]
      [ 141.033676]
      [ 141.033676] other info that might help us debug this:
      [ 141.034304] Possible unsafe locking scenario:
      [ 141.034304]
      [ 141.034875] CPU0
      [ 141.035121] ----
      [ 141.035366] lock(&mo->oo_sem);
      [ 141.035678] lock(&mo->oo_sem);
      [ 141.035993]
      [ 141.035993] *** DEADLOCK ***
      [ 141.035993]
      [ 141.037086] May be due to missing lock nesting notation
      [ 141.037086]
      [ 141.037727] 3 locks held by ll_ost00_002/7298:
      [ 141.038186] #0: 000000003540612a (&m->ofd_lastid_rwsem)

      {.+.+}

      , at: ofd_create_hdl+0x1a9/0x2270 [ofd]
      [ 141.039081] #1: 00000000ee55375f (&oseq->os_create_lock){..}, at: ofd_create_hdl+0x364/0x2270 [ofd]
      [ 141.039969] #2: 0000000086a83aaf (&mo->oo_sem){++++}, at: osd_write_lock+0x8a/0xb0 [osd_zfs]
      [ 141.041147]
      [ 141.041147] stack backtrace:
      [ 141.041568] CPU: 0 PID: 7298 Comm: ll_ost00_002 Tainted: G O --------- - - 4.18.0-debug #8
      [ 141.042465] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      [ 141.043004] Call Trace:
      [ 141.043256] dump_stack+0x106/0x175
      [ 141.043600] validate_chain.isra.26.cold.44+0x224/0x2da
      [ 141.044103] __lock_acquire+0x3df/0xa70
      [ 141.044535] lock_acquire+0x13a/0x370
      [ 141.044908] ? osd_write_lock+0x8a/0xb0 [osd_zfs]
      [ 141.045372] down_write_nested+0x6f/0x120
      [ 141.045770] ? osd_write_lock+0x8a/0xb0 [osd_zfs]
      [ 141.046236] osd_write_lock+0x8a/0xb0 [osd_zfs]
      [ 141.046694] ofd_precreate_objects+0x1764/0x2480 [ofd]
      [ 141.047201] ofd_create_hdl+0xbec/0x2270 [ofd]
      [ 141.047722] tgt_handle_request0+0xdf/0x890 [ptlrpc]
      [ 141.048274] tgt_request_handle+0x3ca/0x1aa0 [ptlrpc]
      [ 141.048789] ? libcfs_nid2str_r+0x12e/0x160 [lnet]
      [ 141.049332] ptlrpc_server_handle_request+0x634/0x1180 [ptlrpc]
      [ 141.049898] ? __wake_up+0x17/0x20
      [ 141.050299] ptlrpc_main+0xd7f/0x1470 [ptlrpc]
      [ 141.050794] ? ptlrpc_register_service+0x14c0/0x14c0 [ptlrpc]
      [ 141.051353] kthread+0x190/0x1c0
      [ 141.051668] ? kthread_create_worker+0x90/0x90
      [ 141.052102] ret_from_fork+0x3a/0x50

      we should use different subclass to silent the lockdep false warning.

      Attachments

        Issue Links

          Activity

            [LU-12509] lockdep warning in ofd_precreate_objects()
            pjones Peter Jones added a comment -

            Landed for 2.13

            pjones Peter Jones added a comment - Landed for 2.13

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35420/
            Subject: LU-12509 ofd: ofd_precreate_objects lockdep warning
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 697dcf4e87f2dbebe57f3ccb9c0b0962b89cf1b4

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35420/ Subject: LU-12509 ofd: ofd_precreate_objects lockdep warning Project: fs/lustre-release Branch: master Current Patch Set: Commit: 697dcf4e87f2dbebe57f3ccb9c0b0962b89cf1b4

            hmm, took Oleg's .config for rhel8, but still can't get the warning.. keep trying.

            bzzz Alex Zhuravlev added a comment - hmm, took Oleg's .config for rhel8, but still can't get the warning.. keep trying.
            dongyang Dongyang Li added a comment - This is actually found by Oleg, see here: http://testing.linuxhacker.ru:3333/lustre-reports/dev/7/testresults/racer-zfs-rhel8.0_x86_64-rhel8.0_x86_64/oleg103-server-console.txt and here: http://testing.linuxhacker.ru:3333/lustre-reports/dev/7/

            what exact kernel options do you use to cause the warning?
            I'm using linux-4.18.0-32.el8 with the following options:
            CONFIG_LOCKDEP_SUPPORT=y
            CONFIG_LOCKDEP=y
            CONFIG_DEBUG_LOCKDEP=y
            but can't reproduce the warning.

            bzzz Alex Zhuravlev added a comment - what exact kernel options do you use to cause the warning? I'm using linux-4.18.0-32.el8 with the following options: CONFIG_LOCKDEP_SUPPORT=y CONFIG_LOCKDEP=y CONFIG_DEBUG_LOCKDEP=y but can't reproduce the warning.
            dongyang Dongyang Li added a comment -

            Looks like 31293 changed the dt_write_lock order, so if we have 31293 landed, we don't need this patch anymore.

            dongyang Dongyang Li added a comment - Looks like 31293 changed the dt_write_lock order, so if we have 31293 landed, we don't need this patch anymore.

            Alex, does this relate to your patch https://review.whamcloud.com/31293 "LU-10048 ofd: take local locks within transaction"?

            adilger Andreas Dilger added a comment - Alex, does this relate to your patch https://review.whamcloud.com/31293 " LU-10048 ofd: take local locks within transaction "?

            People

              dongyang Dongyang Li
              dongyang Dongyang Li
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: