Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-10938 Metadata writeback cache support
  3. LU-15499

WBC: deadlock for buffered write in parallel when test with dcp/ior

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 9223372036854775807

    Description

      When benchmark with IOR, we found the following deadlock:

      memfs_file_write_iter()
      {
          ....
          down_read(&wbci->wbci_rw_sem); // lock 1
           if (wbc_inode_data_caching(wbci)) {
                      inode_lock(inode);     // lock 2
                      rc = generic_write_checks(iocb, iter);
                      if (rc > 0)
                              rc = __generic_file_write_iter(iocb, iter);
                      inode_unlock(inode);
                       ....
          }
          up_read(&wbci->wbci_rw_sem);
          ....
      }
      
      memfs_write_begin(...)
      {
          rc = memfs_write_getpage(inode, index, pagep);
              if (rc == -ENOSPC) {
                      int rc2;
      
                      // need to call inode_unlock(inode);
                      up_read(&wbci->wbci_rw_sem);
                      rc2 = wbc_make_data_commit(file->f_path.dentry);
                      down_read(&wbci->wbci_rw_sem);
                      // need to call inode_lock(inode);
                      if (rc2 < 0)
                              rc = rc2;
              }
      
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: