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

obj: always log an error that occurs in heap action processing #5589

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libpmemobj/palloc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2015-2022, Intel Corporation */
/* Copyright 2015-2023, Intel Corporation */

/*
* palloc.c -- implementation of pmalloc POSIX-like API
Expand Down Expand Up @@ -269,13 +269,13 @@ palloc_heap_action_exec(struct palloc_heap *heap,
/* suppress unused-parameter errors */
SUPPRESS_UNUSED(heap);

#ifdef DEBUG
Copy link
Contributor

Choose a reason for hiding this comment

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

You add not only logging but also reading. The thought is that this can affect performance.

Copy link
Member

Choose a reason for hiding this comment

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

This will cause one extra PMem memory access on all heap operations. It might be worth checking if the performance impact isn't negligible.

enum memblock_state s = act->m.m_ops->get_state(&act->m);
if (s == act->new_state || s == MEMBLOCK_STATE_UNKNOWN) {
ERR("invalid operation or heap corruption");
#ifdef DEBUG
ASSERT(0);
}
#endif /* DEBUG */
}

/*
* The actual required metadata modifications are chunk-type
Expand Down