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

Avoid using ptlrpc_thread where is in't needed

Details

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

    Description

      Several places in lustre use 'struct ptlrpc_thread' to "help" manage a kthread.

      These places are not directly related to ptlrpc, so the naming is not help, and in general the usage of ptlrpc_thread does not improve the code.

      By removing the use of ptlrpc_thread - particularly by avoiding startup synchornization and by using kthread_stop/ kthread_should_stop(), I can reduce code size by a couple of hundred lines.

      Using the seemly uniform approach of ptlrpc_thread can lead to an impression that these threads are all managed much the same way, but this is not the case.  There is substantial variety on how the threads work and exposing that clear will benefit maintainability.

       

      Attachments

        Issue Links

          Activity

            [LU-12780] Avoid using ptlrpc_thread where is in't needed
            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/36262/
            Subject: LU-12780 ofd: don't use ptlrpc_thread for consistency verification
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: cb3c65d4a10b2ad0a6c70d5e38719bca3d501efb

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36262/ Subject: LU-12780 ofd: don't use ptlrpc_thread for consistency verification Project: fs/lustre-release Branch: master Current Patch Set: Commit: cb3c65d4a10b2ad0a6c70d5e38719bca3d501efb

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38824/
            Subject: LU-12780 osd: use native kthreads for scrub.
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: b76df292c241a6db8dfad76d0f5f4cb8babe22bf

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38824/ Subject: LU-12780 osd: use native kthreads for scrub. Project: fs/lustre-release Branch: master Current Patch Set: Commit: b76df292c241a6db8dfad76d0f5f4cb8babe22bf
            neilb Neil Brown added a comment -

            (oops, I meant to reply to the above, but inadvertently editted the comment instead.  I didn't know I could do that, but think I've put it back properly).

             

            > Are there any known bugs with scrub that are know to be fixed or might be fixed by the change?

            I didn't find any clear races, but I didn't look very hard.  It is probably that the flags are changed very rarely, so any races that are possible are extremely unlikely.

            My main reason for the patch was that I was going to add another flag which could change asynchronously, and I didn't think that would be safe without proper locking.

             

            neilb Neil Brown added a comment - (oops, I meant to reply to the above, but inadvertently editted the comment instead.  I didn't know I could do that, but think I've put it back properly).   > Are there any known bugs with scrub that are know to be fixed or might be fixed by the change? I didn't find any clear races, but I didn't look very hard.  It is probably that the flags are changed very rarely, so any races that are possible are extremely unlikely. My main reason for the patch was that I was going to add another flag which could change asynchronously, and I didn't think that would be safe without proper locking.  
            spitzcor Cory Spitz added a comment - - edited

            From https://review.whamcloud.com/38974:

            If two of these updates can race, corruption can occurs

            Are there any known bugs with scrub that are know to be fixed or might be fixed by the change?

            spitzcor Cory Spitz added a comment - - edited From https://review.whamcloud.com/38974: If two of these updates can race, corruption can occurs Are there any known bugs with scrub that are know to be fixed or might be fixed by the change?

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38974/
            Subject: LU-12780 scrub: all update to bitfields must be protected.
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 23a6e1ed8eec2c07653ed07c35bb109ecb87a5b7

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38974/ Subject: LU-12780 scrub: all update to bitfields must be protected. Project: fs/lustre-release Branch: master Current Patch Set: Commit: 23a6e1ed8eec2c07653ed07c35bb109ecb87a5b7

            Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/38974
            Subject: LU-12780 scrub: all update to bitfields must be protected.
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: f8ff777659f2152528085c77789c08fcca81301d

            gerrit Gerrit Updater added a comment - Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/38974 Subject: LU-12780 scrub: all update to bitfields must be protected. Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: f8ff777659f2152528085c77789c08fcca81301d

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38612/
            Subject: LU-12780 quota: don't use ptlrpc_thead of qmt_pool_recalc
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: d9094cf66b54c953416969e8581e1f3a6df461b0

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38612/ Subject: LU-12780 quota: don't use ptlrpc_thead of qmt_pool_recalc Project: fs/lustre-release Branch: master Current Patch Set: Commit: d9094cf66b54c953416969e8581e1f3a6df461b0

            Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/38824
            Subject: LU-12780 osd: use native kthreads for scrub.
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 562bf522f156df53d4d298fd9b144398301b50d8

            gerrit Gerrit Updater added a comment - Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/38824 Subject: LU-12780 osd: use native kthreads for scrub. Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 562bf522f156df53d4d298fd9b144398301b50d8

            Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/38612
            Subject: LU-12780 quota: don't use ptlrpc_thead of qmt_pool_recalc
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 6fa73578014258098e0f86e8b448d8fbb2290a8d

            gerrit Gerrit Updater added a comment - Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/38612 Subject: LU-12780 quota: don't use ptlrpc_thead of qmt_pool_recalc Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 6fa73578014258098e0f86e8b448d8fbb2290a8d

            People

              neilb Neil Brown
              neilb Neil Brown
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: