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

Adapt to JuliaLang/julia#38487. #568

Merged
merged 1 commit into from
Jan 4, 2021
Merged

Adapt to JuliaLang/julia#38487. #568

merged 1 commit into from
Jan 4, 2021

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Nov 24, 2020

No description provided.

@maleadt
Copy link
Member Author

maleadt commented Nov 24, 2020

Annoying how the threading test doesn't fail after removing the protections (but without the PR in Julia being merged)... Maybe now we device_reset! at the beginning of every test there isn't enough memory pressure.

@maleadt
Copy link
Member Author

maleadt commented Nov 24, 2020

Benchmarks caught it!

WARNING: Error while freeing CuPtr{Nothing}(0x00007fff63d8b600):
AssertionError(msg="!(islocked(nrl.rl)) || nrl.rl.locked_by !== current_task()")

@vchuravy
Copy link
Member

We still need the @spinlock? Maybe worth adding to Julia base?

@maleadt
Copy link
Member Author

maleadt commented Nov 24, 2020

We still need the @spinlock?

I think so. We can't wait from within a finalizer, because that would cause a task switch. So if another thread is in free (which can happen from non-finalizer code because of unsafe_free) we just need to wait until that's done. So we spin.

This seems pretty specific, so I'm not sure it's useful for Base (where there already is a spinlock for when all uses should spin).

@vchuravy
Copy link
Member

vchuravy commented Dec 3, 2020

Yeah @jpsamaroo is running into this with trying to make Distributed.jl thread-safe, but maybe we can use Spinlocks there.

@codecov
Copy link

codecov bot commented Dec 7, 2020

Codecov Report

Merging #568 (8e3d94e) into master (8eb218d) will decrease coverage by 0.01%.
The diff coverage is 58.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #568      +/-   ##
==========================================
- Coverage   79.94%   79.93%   -0.02%     
==========================================
  Files         116      116              
  Lines        6870     6861       -9     
==========================================
- Hits         5492     5484       -8     
+ Misses       1378     1377       -1     
Impacted Files Coverage Δ
src/pool.jl 73.02% <50.00%> (-0.58%) ⬇️
src/pool/simple.jl 87.30% <50.00%> (ø)
src/pool/binned.jl 89.56% <66.66%> (ø)
src/pool/split.jl 93.29% <66.66%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa591bb...8e3d94e. Read the comment docs.

@maleadt maleadt merged commit 5dce3d7 into master Jan 4, 2021
@maleadt maleadt deleted the tb/safe_lock branch January 4, 2021 16:14
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.

None yet

2 participants