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

HSM recv buffer reallocated unnecessarily

Details

    • 13954

    Description

      Currently, the 1 MB buffer used by llapi_hsm_copytool_recv is allocated and freed every time through the ct_run loop.

      This is unnecessary, as long as the copy tool clears the the data before calling llapi_hsm_copytool_recv, which lhsmtool_posix already does.

      This patch allocates the buffer once in llapi_hsm_copytool_register and frees it in unregister.

      Patch will be available in Gerrit shortly.

      Attachments

        Activity

          [LU-5051] HSM recv buffer reallocated unnecessarily
          jamesanunez James Nunez (Inactive) added a comment - Patch for b2_5 at http://review.whamcloud.com/#/c/10716
          pjones Peter Jones added a comment -

          Landed for 2.6

          pjones Peter Jones added a comment - Landed for 2.6

          I will monitor this one, thanks for the patch.

          cliffw Cliff White (Inactive) added a comment - I will monitor this one, thanks for the patch.

          Patch is here:
          http://review.whamcloud.com/#/c/10299/

          Needs refresh, doing that shortly...

          paf Patrick Farrell (Inactive) added a comment - Patch is here: http://review.whamcloud.com/#/c/10299/ Needs refresh, doing that shortly...

          I opened LU-5059 via Maloo for the test failures. (On all of the test runs, all of the sub tests passed, but the overall suite still reported failure...)

          paf Patrick Farrell (Inactive) added a comment - I opened LU-5059 via Maloo for the test failures. (On all of the test runs, all of the sub tests passed, but the overall suite still reported failure...)
          rread Robert Read added a comment -

          Yes, please change the label, in case you are still wondering about that.

          As for the memset issue - Patrick mentioned that the copytool is currently clearing the data but I didn't see it doing that. Since this buffer was being managed by the API then it made sense to me to clear it there, but I agree it might not be required, either.

          rread Robert Read added a comment - Yes, please change the label, in case you are still wondering about that. As for the memset issue - Patrick mentioned that the copytool is currently clearing the data but I didn't see it doing that. Since this buffer was being managed by the API then it made sense to me to clear it there, but I agree it might not be required, either.
          fzago Frank Zago (Inactive) added a comment - - edited

          The existing code is not memset'ing the buffer (using malloc, not calloc), and it belongs to the application, so there's no leak involved. Since it's also a very large buffer, I don't think we should add that.

          fzago Frank Zago (Inactive) added a comment - - edited The existing code is not memset'ing the buffer (using malloc, not calloc), and it belongs to the application, so there's no leak involved. Since it's also a very large buffer, I don't think we should add that.

          Good point, I can update the patch to do that. Before I do that, would you weigh in on my comment in the patch:
          [...] In llapi_hsm_copytool_recv, now that we no longer free the buffer at the end of this function, should we rename "out_free" to "out_err"?

          I'm probably going to make that change unless anyone disagrees.

          paf Patrick Farrell (Inactive) added a comment - Good point, I can update the patch to do that. Before I do that, would you weigh in on my comment in the patch: [...] In llapi_hsm_copytool_recv, now that we no longer free the buffer at the end of this function, should we rename "out_free" to "out_err"? I'm probably going to make that change unless anyone disagrees.
          rread Robert Read added a comment -

          Would it make sense fir llapi_hsm_copytool_recv() to reinitialize the buffer memset(0) each time rather than relying on the application to do this?

          rread Robert Read added a comment - Would it make sense fir llapi_hsm_copytool_recv() to reinitialize the buffer memset(0) each time rather than relying on the application to do this?

          People

            cliffw Cliff White (Inactive)
            paf Patrick Farrell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: