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

replace ext4_commit_callback_add() usage

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • Lustre 2.17.0
    • 3
    • 9223372036854775807

    Description

      It is likely that the upstream ext4 code will remove the ext4_commit_callback_add() interface in the upstream kernel in the 6.14 or 6.15 release, since it is no longer used by any code in the kernel. It is also likely that the transaction->t_private_list will be removed at the same time, because the removal of ext4_commit_callback_add() means there are no other users in the kernel tree.

      This means it is likely that we will need to implement some equivalent functionality. A few ideas for implementing this include:

      • patch ext4_commit_callback_add() back into ldiskfs. However, the removal of t_private_list will make this more complex to associate data with a specific transaction, so I don't think a drop-in re-implementation only in the ldiskfs code is possible.
      • replace sbi->s_journal->j_commit_callback = ext4_journal_commit_callback() at osd-ldiskfs mount time with our own osd_journal_commit_callback() to implement our own callback mechanism, and call ext4_journal_commit_callback() internally to maintain compatibility without patching ldiskfs more than we need to
      • use a similar hack as ext4_process_freed_data() and put an array of list_heads (4?) in the ext4 superblock (or osd_device?) and index them by (t_tid % num_heads), so that ext4_journal_commit_callback() can use the passed txn->t_tid to determine which list_head to use. Then, move all of the commit callbacks to a separate "global" list so they can be processed asynchronously instead of blocking the transaction commit. Preferably we would still keep the ext4_commit_callback_add() function name, even if the internal implementation is different, to simplify code portability.

      This work is helped by patch https://review.whamcloud.com/17270 ("LU-7251 osp: do not assign commit callback to every thandle") since it keeps an osd-ldiskfs level list of commit callbacks for transno update, rather than registering every commit callback with the JBD2 layer. We will still need to track multiple commit callbacks against the specific transaction commit, but these could be handled by indexing the registered callbacks with the current t_tid into the callback array so that they are called by the right transaction commit.

      Attachments

        Activity

          People

            wc-triage WC Triage
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: