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

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

Merged

Conversation

adnan-alhomssi
Copy link
Contributor

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/jl_exported_funcs.inc Outdated Show resolved Hide resolved
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
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
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
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
Sponsor 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 status: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 status:merge me PR is reviewed. Merge when all tests are passing labels Sep 14, 2023
@NHDaly
Copy link
Member

NHDaly commented Sep 20, 2023

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

@NHDaly NHDaly added status: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
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
Sponsor 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
6 checks passed
@DilumAluthge DilumAluthge removed the status: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 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
Drvi pushed a commit to RelationalAI/julia that referenced this pull request Feb 28, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Mar 1, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Mar 13, 2024
Drvi pushed a commit to RelationalAI/julia that referenced this pull request Apr 3, 2024
d-netto pushed a commit to RelationalAI/julia that referenced this pull request Apr 16, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Apr 23, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Apr 24, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Apr 30, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Apr 30, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request May 2, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request May 9, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request May 19, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request May 26, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request May 28, 2024
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request May 29, 2024
Drvi pushed a commit to RelationalAI/julia that referenced this pull request Jun 7, 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