Skip to content

Export num_stack_mappings to track the number of in-flight stack mappings and tasks in application#51301

Merged
DilumAluthge merged 6 commits intoJuliaLang:masterfrom
adnan-alhomssi:aa-export-numstacks-counter
Sep 20, 2023
Merged

Export num_stack_mappings to track the number of in-flight stack mappings and tasks in application#51301
DilumAluthge merged 6 commits intoJuliaLang:masterfrom
adnan-alhomssi:aa-export-numstacks-counter

Conversation

@adnan-alhomssi
Copy link
Copy Markdown

Julia already tracks the number of mapped stacks for Julia tasks in a local atomic.
Exporting this atomic will allow applications to estimate the memory consumption by the stacks and also the number of in-flight tasks.

@adnan-alhomssi adnan-alhomssi changed the title Export a metric for the number of in-flight stack mappings Export num_stack_mappings to track the number of in-flight stack mappings and tasks in application Sep 13, 2023
src/gc-stacks.c Outdated
Comment on lines +76 to +79
JL_DLLEXPORT uint32_t jl_get_num_stack_mappings() {
return jl_atomic_load_relaxed(&num_stack_mappings);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this also be exposed through a julia function in Base? Or is it okay to just expose the ccall like this?

@c42f: Are you the expert now on what "public" / "exported" means?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think keeping it a ccall is fine

Copy link
Copy Markdown
Member

@NHDaly NHDaly left a comment

Choose a reason for hiding this comment

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

LGTM pending adding a test

@vchuravy
Copy link
Copy Markdown
Member

I think the PR is fine (aside from the test that Nathan mentioned), but not that you could also export the global and then access it from Julia directly,

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Sep 13, 2023
@DilumAluthge DilumAluthge added needs tests Unit tests are required for this change and removed merge me PR is reviewed. Merge when all tests are passing labels Sep 14, 2023
@NHDaly
Copy link
Copy Markdown
Member

NHDaly commented Sep 20, 2023

@vchuravy I don't think we can jl_atomic_load_relaxed from julia-side, can we?

@NHDaly NHDaly force-pushed the aa-export-numstacks-counter branch from 8f1f4ad to ab68148 Compare September 20, 2023 02:57
@NHDaly NHDaly added merge me PR is reviewed. Merge when all tests are passing and removed needs tests Unit tests are required for this change labels Sep 20, 2023
@NHDaly
Copy link
Copy Markdown
Member

NHDaly commented Sep 20, 2023

Thanks all. Sorry for the delay here. I've added a test, so this should be ready to go. Please merge as soon as tests are green! Thank you

NHDaly added a commit to RelationalAI/julia that referenced this pull request Sep 20, 2023
Export num_stack_mappings to track the number of in-flight stack mappings and tasks in application JuliaLang#51301
@vchuravy
Copy link
Copy Markdown
Member

@vchuravy I don't think we can jl_atomic_load_relaxed from julia-side, can we?

We can, but I don't think we have specified if Julia and C agree on the data layout

adnan-alhomssi pushed a commit to RelationalAI/julia that referenced this pull request Sep 20, 2023
Export num_stack_mappings to track the number of in-flight stack mappings and tasks in application JuliaLang#51301
@DilumAluthge DilumAluthge merged commit 8f95c6b into JuliaLang:master Sep 20, 2023
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Sep 20, 2023
kpamnany pushed a commit to RelationalAI/julia that referenced this pull request Oct 19, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Oct 20, 2023
kpamnany pushed a commit to RelationalAI/julia that referenced this pull request Oct 21, 2023
kpamnany pushed a commit to RelationalAI/julia that referenced this pull request Oct 21, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Nov 29, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 3, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 4, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 13, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 17, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 18, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 19, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 23, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 24, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 25, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Dec 26, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 6, 2024
Drvi pushed a commit to RelationalAI/julia that referenced this pull request Jan 8, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 13, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 14, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 15, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 17, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 18, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 23, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 24, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 25, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 27, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 30, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 31, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Feb 1, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Feb 6, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Feb 7, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Feb 14, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Feb 21, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Feb 22, 2024
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.

6 participants