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

Replace LASSERT_ATOMIC_* (atomic_t) with reference counters (refcount)

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • 3
    • 9223372036854775807

    Description

       

      For Example.

      struct ptlrpc_sec {      
      ....
      atomic_t ps_refcount;    
      };
      

      Which is called as...

      LASSERT_ATOMIC_ZERO(&sec->ps_refcount);

      Now becomes

      struct ptlrpc_sec {      
      ....
      struct kref ps_refcount;
      };
      

      and every thing should follow to support the above.

       

      Currently these are under active use:

      LASSERT_ATOMIC_GT
      LASSERT_ATOMIC_GT_LT
      LASSERT_ATOMIC_ZERO
      LASSERT_ATOMIC_POS

      Attachments

        Issue Links

          Activity

            [LU-16796] Replace LASSERT_ATOMIC_* (atomic_t) with reference counters (refcount)

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/58453/
            Subject: LU-16796 nodemap: Change nm_refcount to refcount
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 776f9430201d26af4e1167e8c5fea6f4012bc641

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/58453/ Subject: LU-16796 nodemap: Change nm_refcount to refcount Project: fs/lustre-release Branch: master Current Patch Set: Commit: 776f9430201d26af4e1167e8c5fea6f4012bc641

            "James Simmons <jsimmons@infradead.org>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58453
            Subject: LU-16796 nodemap: Change nm_refcount to refcount
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 675cc38609159760c95ae1465ff65a5d6d5d528d

            gerrit Gerrit Updater added a comment - "James Simmons <jsimmons@infradead.org>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58453 Subject: LU-16796 nodemap: Change nm_refcount to refcount Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 675cc38609159760c95ae1465ff65a5d6d5d528d

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/56364/
            Subject: LU-16796 ptlrpc: Change struct ptlrpc_reply_state to use kref
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 782b21a969abc1302fab2198101e692d3b6eff41

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/56364/ Subject: LU-16796 ptlrpc: Change struct ptlrpc_reply_state to use kref Project: fs/lustre-release Branch: master Current Patch Set: Commit: 782b21a969abc1302fab2198101e692d3b6eff41

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/56195/
            Subject: LU-16796 lfsck: Change lfsck_instance to use refcount_t
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 2a45af9061cf08acfd965d4ad043b61515b9680a

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/56195/ Subject: LU-16796 lfsck: Change lfsck_instance to use refcount_t Project: fs/lustre-release Branch: master Current Patch Set: Commit: 2a45af9061cf08acfd965d4ad043b61515b9680a

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/53459/
            Subject: LU-16796 ptlrpc: Change struct ptlrpc_request_set to use kref
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: b00779bf2dbf783bc7a7dcb9ebd5601ab5cddaca

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/53459/ Subject: LU-16796 ptlrpc: Change struct ptlrpc_request_set to use kref Project: fs/lustre-release Branch: master Current Patch Set: Commit: b00779bf2dbf783bc7a7dcb9ebd5601ab5cddaca
            arshad512 Arshad Hussain added a comment - - edited

            Status of work left for this ticket.

            Initialization value is not 1 (No change required)

            ptlrpc/sec.c:                rq_refcount
            ptlrpc/ptlrpc_internal.h:    rq_refcount
            ptlrpc/sec_plain.c:          cc_refcount
            mgs/mgs_llog.c:              fsdb_ref
            ldlm/ldlm_pool.c:            pl_lock_volume_factor
            llite/pcc.c:                 pcci_refcount

            Along with kref'ed structure extra data-structures reference is called in release function (Will be done last, requires major code change or cannot be done)

            osp/osp_trans.c:            ot_refcount
            obdclass/obd_mount.c:       cl_mgc_refcount
            obdclass/lu_object.c:       loh_ref
            lfsck/lfsck_striped_dir.c:  ll_ref
            lfsck/lfsck_striped_dir.c:  ll_ref
            lfsck/lfsck_layout.c:       lc_ref
            lfsck/lfsck_namespace.c:    lc_ref
            lfsck/lfsck_engine.c:       ll_ref
             
            

            Does not do any memory release. No change required (No change necessary)

            ptlrpc/connection.c:        c_refcount
            quota/qsd_lib.c:            qqi_ref
            obdclass/cl_io.c:           csi_complete
            obdclass/lu_object.c:       lct_used

            Todo:(investigation left)

            llite/statahead.c:                sax_refcount
            llite/statahead.c:                sai_refcount
            ptlrpc/gss/sec_gss.c:             src_base.sc_refcount
            obdclass/lprocfs_status_server.c: nid_exp_ref_count
            obdclass/llog_obd.c:              loc_refcount

            WIP

            include/obd.h:              mod_refcount

             

             

             

             

             

            arshad512 Arshad Hussain added a comment - - edited Status of work left for this ticket. Initialization value is not 1 (No change required) ptlrpc/sec.c:                rq_refcount ptlrpc/ptlrpc_internal.h:    rq_refcount ptlrpc/sec_plain.c:          cc_refcount mgs/mgs_llog.c:              fsdb_ref ldlm/ldlm_pool.c:            pl_lock_volume_factor llite/pcc.c:                 pcci_refcount Along with kref'ed structure extra data-structures reference is called in release function (Will be done last, requires major code change or cannot be done) osp/osp_trans.c:            ot_refcount obdclass/obd_mount.c:       cl_mgc_refcount obdclass/lu_object.c:       loh_ref lfsck/lfsck_striped_dir.c:  ll_ref lfsck/lfsck_striped_dir.c:  ll_ref lfsck/lfsck_layout.c:       lc_ref lfsck/lfsck_namespace.c:    lc_ref lfsck/lfsck_engine.c:       ll_ref   Does not do any memory release. No change required (No change necessary) ptlrpc/connection.c:        c_refcount quota/qsd_lib.c:            qqi_ref obdclass/cl_io.c:           csi_complete obdclass/lu_object.c:       lct_used Todo:(investigation left) llite/statahead.c:            sax_refcount llite/statahead.c:             sai_refcount ptlrpc/gss/sec_gss.c:             src_base.sc_refcount obdclass/lprocfs_status_server.c: nid_exp_ref_count obdclass/llog_obd.c:             loc_refcount WIP include/obd.h:              mod_refcount          

            "Arshad Hussain <arshad.hussain@aeoncomputing.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58309
            Subject: LU-16796 obdclass: Change struct local_oid_storage to use kref
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 8fa0bdae73fe73524107dd6d7fad638d83c02fb6

            gerrit Gerrit Updater added a comment - "Arshad Hussain <arshad.hussain@aeoncomputing.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58309 Subject: LU-16796 obdclass: Change struct local_oid_storage to use kref Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 8fa0bdae73fe73524107dd6d7fad638d83c02fb6

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/56454/
            Subject: LU-16796 quota: Change struct lquota_entry to use kref
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 01d10c84ad64bfbfe60c45267e9ac9b441191025

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/56454/ Subject: LU-16796 quota: Change struct lquota_entry to use kref Project: fs/lustre-release Branch: master Current Patch Set: Commit: 01d10c84ad64bfbfe60c45267e9ac9b441191025

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/56193/
            Subject: LU-16796 ptlrpc: Change struct nrs_tbf_rule to use kref
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 308c7a553809695d475bbb640ffe1c86efd9719f

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/56193/ Subject: LU-16796 ptlrpc: Change struct nrs_tbf_rule to use kref Project: fs/lustre-release Branch: master Current Patch Set: Commit: 308c7a553809695d475bbb640ffe1c86efd9719f
            arshad512 Arshad Hussain added a comment - - edited

            This can be seen on Master with 5.14.0-362.13.1.el9_3.x86_64. Plain venilla Rocky9.3. Running just test 77j(only gets after fresh boot, otherwise it is not seen) gets below refcount_t warning. This is different from what you are seeing on 4.18 kernel at least i can reproduce this warning. Opened LU-18606 for both refcount_t error/warning.

            arshad512 Arshad Hussain added a comment - - edited This can be seen on Master with 5.14.0-362.13.1.el9_3.x86_64. Plain venilla Rocky9.3. Running just test 77j(only gets after fresh boot, otherwise it is not seen) gets below refcount_t warning. This is different from what you are seeing on 4.18 kernel at least i can reproduce this warning. Opened LU-18606 for both refcount_t error/warning.

            People

              arshad512 Arshad Hussain
              arshad512 Arshad Hussain
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: