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

HSM: record the index when scan HSM action llog for new HSM requests

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.15.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      After analyze online for HSM workload, we found the following contention between HSM archive request and hsm_cdtr thread:

      hsm_archive:
        mdt_hsm_add_actions
        mdt_hsm_register_hal
        mdt_agent_record_add
          down_write(&cdt->cdt_llog_lock);
          llog_cat_add()
          up_write(&cdt->cdt_llog_lock);
      
      
      // hsm_cdtr kernel daemon thread:
      mdt_coordinator()
        cdt_llog_process(mti->mti_env, mdt, mdt_coordinator_cb,
      				      &hsd, 0, 0, WRITE);
          down_write(&cdt->cdt_llog_lock);
          llog_cat_process
          up_write(&cdt->cdt_llog_lock);
      
      # top
      PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
       7675 root      20   0       0      0      0 R 100.0  0.0   8729:13 hsm_cdtr
          1 root      20   0   53984   6232   2604 S   0.0  0.0   3:17.86 systemd
          2 root      20   0       0      0      0 S   0.0  0.0   0:00.62 kthreadd
          4 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H
      

      HSM archive and kernel thread hsm_cdtr are both contented for cdt->cdt_llog_lock to add or update the hsm_action llog.

      The testing is use max_requests = 10000:

      mdt.isg-tiny-MDT0000.hsm.max_requests=10000
      

      It means "hsm_cdtr" kernel thread will scan 10000 llog actions with write lock held in the whole processing, reduce the max_requests to a small value (i.e. 256) should be mitigate the problem. Or we can release the write lock when scan certain number of hsm actions (128) in llog, resched and then re-acquire the write lock to go on scanning the hsm action llog.

      And also when "hsm_cdtr" scan the hsm_action llog, we should record the latest cookie that has been handled, next scanning should be started from the previous end position .

      Attachments

        Issue Links

          Activity

            [LU-14793] HSM: record the index when scan HSM action llog for new HSM requests
            pjones Peter Jones made changes -
            Link Original: This issue is related to JFC-17 [ JFC-17 ]
            pjones Peter Jones made changes -
            Link Original: This issue is related to JFC-10 [ JFC-10 ]
            pjones Peter Jones made changes -
            Link New: This issue is related to JFC-20 [ JFC-20 ]
            pjones Peter Jones made changes -
            Link New: This issue is related to JFC-17 [ JFC-17 ]
            pjones Peter Jones made changes -
            Fix Version/s New: Lustre 2.15.0 [ 14791 ]
            Resolution New: Fixed [ 1 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]
            pjones Peter Jones added a comment -

            Landed for 2.15

            pjones Peter Jones added a comment - Landed for 2.15

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/44077/
            Subject: LU-14793 hsm: record index for further HSM action scanning
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: a15a5432f8063e3a04a87d74eafac0060a8f9d26

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/44077/ Subject: LU-14793 hsm: record index for further HSM action scanning Project: fs/lustre-release Branch: master Current Patch Set: Commit: a15a5432f8063e3a04a87d74eafac0060a8f9d26
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-13651 [ LU-13651 ]
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-13689 [ LU-13689 ]
            pjones Peter Jones made changes -
            Link New: This issue is related to JFC-10 [ JFC-10 ]

            People

              qian_wc Qian Yingjin
              qian_wc Qian Yingjin
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: