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

Does insertion of PMTest_* instrumentation need to be done manually? (and other questions on usage) #5

Closed
LouisJenkinsCS opened this issue Feb 10, 2020 · 4 comments

Comments

@LouisJenkinsCS
Copy link

Hello developers,

I was wondering whether or not the instrumentation PMTest_* function (i.e. PMTest_assign, PMTest_flush, PMTest_fence), must be placed manually, or if there is some kind of compiler plugin that I'm missing. Assume I am not using any transactions and am doing it the old-fashioned manually clflush; sfence (or clwb/clflushopt) approach to persistence. I was looking to modify this...

https://github.com/pmem/pmdk/blob/0206f00217755e9b638fae01188e0408fb1e31e6/src/examples/pmreorder/pmreorder_list.c#L140-L153

Since new->next and new->value are meant to persist before the write to root->head, but this example deliberately violates this by persisting root->head before new->value. How would I catch this in PMTest? I got...

void list_insert_inconsistent(struct list_root *root, node_id node, int value)
{
        struct list_node *new = NODE_PTR(root, node);
        PMTest_isPersistedBefore(&new->value, sizeof(new->value),  &root->head, sizeof(root->head));
        PMTest_isPersistedBefore(&new->next, sizeof(new->next), &root->head, sizeof(root->head));

        new->next = root->head;
        PMTest_assign(&new->next, sizeof(new->next));
        PMTest_flush(&new->next, sizeof(new->next));
        PMTest_fence();

        root->head = node;
        PMTest_assign(&root->head, sizeof(root->head));
        PMTest_flush(&root->head, sizeof(root->head));
        PMTest_fence();

        new->value = value;
        PMTest_assign(&new->value, sizeof(new->value));
        PMTest_flush(&new->value, sizeof(new->value));
        PMTest_fence();
}

I'm wondering if PMTest_assign -> PMTest_flush -> PMTest_fence can be kind of automated based on the instructions themselves, like PMDK's pmemcheck does. Is this possible, or do I have to manually instrument everything? Also am I correct in my translation to using PMTest?

Finally, let's say that I do not wish to sendTrace yet... for example, let's say that I have a non-blocking persistent data structure (so transactions are out of the question) that lazily persists certain fields; how does PMTest handle this? As well, during atomic operations, such as compare-and-swap, how should I go about instrumenting that?

Thanks in advance!

@LouisJenkinsCS LouisJenkinsCS changed the title Does insertion of PMTest_* instrumentation need to be done manually? Does insertion of PMTest_* instrumentation need to be done manually? (and other questions on usage) Feb 10, 2020
@LouisJenkinsCS
Copy link
Author

In particular, this slide says "Auto inject low-level checkers for high-level checkers"

Screenshot from 2020-02-12 11-13-29

Does this imply that PMTest does this in some way, or that it can do it (I.E if some higher-level checker existed) or that it is only inside of PMDK Transactions?

@jahidhasanlinix
Copy link

@LouisJenkinsCS Did you able to solve the problem? Any updates please @sihangliu

@sihangliu
Copy link
Owner

Sorry - I have not received any notifications whatsoever, until being @. What was the issue?

@LouisJenkinsCS
Copy link
Author

This issue was more a question on how to make use of PMTest API. My research topic has changed a lot since this point, so I'll close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants