Skip to content

Add more operation analysis, combine with deletes and inserts variables. #9

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

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

linD026
Copy link
Collaborator

@linD026 linD026 commented Aug 9, 2021

Add more operation analysis, combine with deletes and inserts variables.
And Using the preprocessor to decide the analysis being set or not.

For example:

retry     : 187
contains  : 0
traversal : 21028166
fail      : 0
del       : 0
ins       : 0
load      : 63167962
store     : 4096
deletes   : 4098
inserts   : 4098
"retry"    is the number of retries in the __list_find function.
"contains" is the number of wait-free contains in the __list_find function that curr pointer pointed.
"traversal"is the number of list element traversal in the __list_find function.
"fail"     is the number of CAS() failures.
"del"      is the number of list_delete operation failed and restart again.
"ins"      is the number of list_insert operation failed and restart again.
"deletes"  is the number of linked list elements deleted.
"inserts"  is the number of linked list elements created.
"load"     is the number of atomic_load operation in list_delete, list_insert and __list_find.
"store"    is the number of atomic_store operation in list_delete, list_insert and __list_find.

The following are the new variables to record the operations:
rtry is the number of retries in the __list_find function.
cons is the number of wait-free contains in the __list_find function that curr pointer pointed.
trav is the number of list element traversal in the __list_find function.
fail is the number of CAS() failures.
del is the number of list_delete operation failed and restart again.
ins is the number of list_insert operation failed and restart again.

@linD026 linD026 force-pushed the master branch 2 times, most recently from 83ad215 to 60c690d Compare August 9, 2021 15:15
@linD026
Copy link
Collaborator Author

linD026 commented Aug 9, 2021

Because the atomic_fetch_add will be only used with recording the operation state in related function in linked list, I think ops just mark the meaning of ATOMIC_FETCH_ADD is doing. Also there is the reason why the body was empty.

@jserv
Copy link
Contributor

jserv commented Aug 9, 2021

However, macro ATOMIC_FETCH_ADD was not consistent if it turns into an empty one.

@linD026
Copy link
Collaborator Author

linD026 commented Aug 9, 2021

I only change ATOMIC_FETCH ADD into TRACE_ATOMIC_FETCH_ADD for distinguishing record operation from normal. There are other solutions, but I think this is the best one because it does not cost more memory or if-else statement.

@linD026 linD026 force-pushed the master branch 2 times, most recently from b91d931 to 5879546 Compare August 9, 2021 19:47
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Use wrapper macro for runtime stat initialization/hook.

@linD026 linD026 force-pushed the master branch 2 times, most recently from 319d216 to ecc3610 Compare August 9, 2021 20:12
hp_list/main.c Outdated
do { \
atomic_store_explicit(obj, desired, order); \
} while (0)
#define TRACE(ops) ({})
Copy link
Contributor

Choose a reason for hiding this comment

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

Rewrite macro TRACE as following:

do { /* nothing involved */ } while (0)

@linD026
Copy link
Collaborator Author

linD026 commented Aug 10, 2021

The names are from A more Pragmatic Implementation of the Lock-free, Ordered, Linked List.
traversal and others are intelligible I will change it.

@jserv
Copy link
Contributor

jserv commented Aug 10, 2021

The names are from A more Pragmatic Implementation of the Lock-free, Ordered, Linked List.
traversal and others are intelligible I will change it.

Cite the publication within comments as well.

And Using the preprocessor to decide the analysis being set or not.

The following are the new varialbes to record the opreations:

rtry  is the number of retries in the __list_find function.
cons  is the number of wait-free contains in the __list_find function that curr pointer pointed.
trav  is the number of list element traversal in the __list_find function.
fail  is the number of CAS() failures.
del   is the number of list_delete operation failed and restart again.
ins   is the number of list_insert operation failed and restart again.
load  is the number of atomic_load operation in list_delete, list_insert and __list_find.
store is the number of atomic_store operation in list_delete, list_insert and __list_find.
@jserv jserv merged commit 58c3197 into sysprog21:master Aug 10, 2021
@jserv
Copy link
Contributor

jserv commented Aug 10, 2021

Thank @linD026 for the great work!

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

Successfully merging this pull request may close these issues.

2 participants