Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-15914: crt_reply_send_input_free() #14817

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

frostedcmos
Copy link
Contributor

  • New crt_reply_send_input_free() API added which releases input buffer right after HG_Respond() instead of waiting until the handle is destroyed.

  • srv_obj.c calls changed to use new crt_reply_send_input_free()

Required-githooks: true

Before requesting gatekeeper:

  • Two review approvals and any prior change requests have been resolved.
  • Testing is complete and all tests passed or there is a reason documented in the PR why it should be force landed and forced-landing tag is set.
  • Features: (or Test-tag*) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.
  • Commit messages follows the guidelines outlined here.
  • Any tests skipped by the ticket being addressed have been run and passed in the PR.

Gatekeeper:

  • You are the appropriate gatekeeper to be landing the patch.
  • The PR has 2 reviews by people familiar with the code, including appropriate owners.
  • Githooks were used. If not, request that user install them and check copyright dates.
  • Checkpatch issues are resolved. Pay particular attention to ones that will show up on future PRs.
  • All builds have passed. Check non-required builds for any new compiler warnings.
  • Sufficient testing is done. Check feature pragmas and test tags and that tests skipped for the ticket are run and now pass with the changes.
  • If applicable, the PR has addressed any potential version compatibility issues.
  • Check the target branch. If it is master branch, should the PR go to a feature branch? If it is a release branch, does it have merge approval in the JIRA ticket.
  • Extra checks if forced landing is requested
    • Review comments are sufficiently resolved, particularly by prior reviewers that requested changes.
    • No new NLT or valgrind warnings. Check the classic view.
    • Quick-build or Quick-functional is not used.
  • Fix the commit message upon landing. Check the standard here. Edit it to create a single commit. If necessary, ask submitter for a new summary.

- New crt_reply_send_input_free() API added which releases input buffer right
  after HG_Respond() instead of waiting until the handle is destroyed.

- srv_obj.c calls changed to use new crt_reply_send_input_free()

Required-githooks: true

Signed-off-by: Alexander A Oganezov <[email protected]>
Copy link

Errors are component not formatted correctly,Ticket number suffix is not a number. See https://daosio.atlassian.net/wiki/spaces/DC/pages/11133911069/Commit+Comments,Unable to load ticket data
https://daosio.atlassian.net/browse/DAOS-15914:

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14817/1/testReport/

- I/O context takes refcount on RPC
- only release input buffer for target update

Signed-off-by: Liang Zhen <[email protected]>
@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14817/2/testReport/

@@ -1516,6 +1516,16 @@ crt_hg_reply_send(struct crt_rpc_priv *rpc_priv)
rc = crt_hgret_2_der(hg_ret);
}

/* Release input buffer */
if (rpc_priv->crp_release_input_early && !rpc_priv->crp_forward) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if we release RPC input buffer only with checking "if (!rpc_priv->crp_forward)"? that will allow us to release input buffer for most of RPCs (except corpc children) without changing the callers' logic (such as the RPC handlers for object/dtx in this patch)? Although the observed timeout RPCs in DAOS-15914 logs were for object update and DTX commit, it does not means that the trouble RPCs holding multiple recv buffer were all for object update and DTX commit, instead, they may be for others, we do not know. So if we can release the input buffer for more RPCs, that may be more helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nasf-Fan we did that in the initial patch (https://github.com/daos-stack/daos/pull/14793/files) and ended up with random memory corruptions, suggesting that something in daos keeps using input buffer still during crt_hg_reply_send().

See Saurabh updates with this error in DAOS-15914:
aurora-daos-0318 ERROR 2024/07/25 00:38:05 daos_engine:0 07/25-00:38:05.15 aurora-daos-0318 DAOS[61709/14/30252] common EMRG src/common/mem.c:1383 set_offsets() Assertion '!OID_IS_NULL(root_oid)' failed: You must call pmemobj_root before umem_class_init daos_engine: src/common/mem.c:1383: set_offsets: Assertion 0' failed.`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I am not sure which RPC handler (since there are too many RPC handlers for kinds of modules) may access the input buffer after early release, but I think that releasing the input buffer only for tgt_update and dtx_commit RPCs seems not enough. I would suggest to do that for all OBJ/DTX sponsored RPCs. If still hit above memory corruption, then it is not difficult to fix related RPC handler (in such two modules).

@mjean308 mjean308 mentioned this pull request Oct 24, 2024
18 tasks
@phender
Copy link
Contributor

phender commented Oct 24, 2024

There was one failure in https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-14817/2/artifact/Functional%20Hardware%20Medium/dfuse/daos_build.py/job.log with 1-./dfuse/daos_build.py:DaosBuild.test_dfuse_daos_build_wb

2024-07-29 00:12:51,217 run_utils        L0272 DEBUG|     gcc -o build/release/gcc/src/utils/ddb/ddb_spdk.os -c -Werror -g -Wextra -Wshadow -Wall -fpic -fstack-usage -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-ignored-attributes -Wfree-nonheap-object -Wframe-larger-than=4096 -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv -fstack-protector-strong -fstack-clash-protection -O2 -DAPI_VERSION=\"2.7.0\" -DDAOS_VERSION=\"2.7.100\" -DCART_VERSION=\"4.9.0\" -fPIC -DD_HAS_VALGRIND -DDAOS_BUILD_RELEASE -D_FORTIFY_SOURCE=2 -DCMOCKA_FILTER_SUPPORTED=0 -D_GNU_SOURCE -DDAOS_PMEM_BUILD=1 -Isrc/include -Ibuild/release/gcc/src/include -Isrc/gurt -Iinstall/prereq/release/mercury/include -Iinstall/prereq/release/isal/include -Isrc/mgmt -Isrc/vos -Ibuild/release/gcc/src/vos -Isrc/bio -Ibuild/release/gcc/src/bio -Iinstall/prereq/release/argobots/include -Iinstall/prereq/release/protobufc/include -Iinstall/prereq/release/pmdk/include -Iinstall/prereq/release/spdk/include src/utils/ddb/ddb_spdk.c
2024-07-29 00:12:51,217 run_utils        L0272 DEBUG|     # github.com/daos-stack/daos/src/control/lib/hardware/pciutils
2024-07-29 00:12:51,217 run_utils        L0272 DEBUG|     lib/hardware/pciutils/bindings.go:23:10: fatal error: pci/pci.h: No such file or directory
2024-07-29 00:12:51,217 run_utils        L0272 DEBUG|      #include <pci/pci.h>
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|               ^~~~~~~~~~~
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     compilation terminated.
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     # github.com/daos-stack/daos/src/control/lib/hardware/pciutils
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     lib/hardware/pciutils/bindings.go:23:10: fatal error: pci/pci.h: No such file or directory
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|      #include <pci/pci.h>
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|               ^~~~~~~~~~~
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     compilation terminated.
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     cd /tmp/daos_dfuse_test_dfuse_daos_build_wb_1/daos/src/control; /bin/go build -mod vendor -ldflags "-X github.com/daos-stack/daos/src/control/build.DaosVersion=2.7.100 -X github.com/daos-stack/daos/src/control/build.ConfigDir=/tmp/daos_dfuse_test_dfuse_daos_build_wb_1/daos/install/etc -X github.com/daos-stack/daos/src/control/build.BuildHost= -X github.com/daos-stack/daos/src/control/build.BuildInfo=v2.5.101-tb-376-g1eb3482e0 -X github.com/daos-stack/daos/src/control/build.BuildTime=2024-07-29T00:12:06.067162+00:00 -B 0x631ca309f7277b9eaead6619d216910757895c09" -buildmode=pie -tags spdk,release -o /tmp/daos_dfuse_test_dfuse_daos_build_wb_1/daos/build/release/gcc/src/control/dmg github.com/daos-stack/daos/src/control/cmd/dmg
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     ar rc build/release/gcc/src/vea/libvea.a build/release/gcc/src/vea/vea_alloc.o build/release/gcc/src/vea/vea_api.o build/release/gcc/src/vea/vea_free.o build/release/gcc/src/vea/vea_hint.o build/release/gcc/src/vea/vea_init.o build/release/gcc/src/vea/vea_util.o
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     ranlib build/release/gcc/src/vea/libvea.a
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     # github.com/daos-stack/daos/src/control/lib/hardware/pciutils
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     lib/hardware/pciutils/bindings.go:23:10: fatal error: pci/pci.h: No such file or directory
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|      #include <pci/pci.h>
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|               ^~~~~~~~~~~
2024-07-29 00:12:51,218 run_utils        L0272 DEBUG|     compilation terminated.

According to https://daosio.atlassian.net/browse/DAOS-16215 this was fixed in release/2.6 by b6fc83e.

@frostedcmos frostedcmos marked this pull request as ready for review October 24, 2024 23:56
@frostedcmos frostedcmos requested review from a team as code owners October 24, 2024 23:56
@frostedcmos
Copy link
Contributor Author

Master version of this patch: #15314

@frostedcmos frostedcmos requested a review from gnailzenh October 24, 2024 23:58
@mchaarawi mchaarawi merged commit 23f0787 into release/2.6 Oct 25, 2024
53 of 54 checks passed
@mchaarawi mchaarawi deleted the aaoganez/DAOS-15914-srv-obj-reply-2.6 branch October 25, 2024 15:51
juszhan1 added a commit that referenced this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants