Skip to content

Fix DramKV race: hold rlock during inplace update writes (#5807)#5807

Closed
q10 wants to merge 1 commit into
pytorch:mainfrom
q10:export-D98427441
Closed

Fix DramKV race: hold rlock during inplace update writes (#5807)#5807
q10 wants to merge 1 commit into
pytorch:mainfrom
q10:export-D98427441

Conversation

@q10
Copy link
Copy Markdown
Contributor

@q10 q10 commented Jun 1, 2026

Summary:

X-link: https://github.com/facebookresearch/FBGEMM/pull/2733

Previously the rlock was released after collecting hit/miss info, then block pointers were written to without the lock held. This allowed eviction to invalidate block pointers during writes. Fix by keeping the rlock held through the entire read-and-write phase using scoped lifetime.

Test Plan:
Imported from GitHub, without a Test Plan: line.

Split from D95983752

Reviewed By: r-barnes

Differential Revision: D98427441

Pulled By: q10

@meta-cla meta-cla Bot added the cla signed label Jun 1, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Jun 1, 2026

@q10 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98427441.

Summary:
Pull Request resolved: pytorch#5807

X-link: https://github.com/facebookresearch/FBGEMM/pull/2733

Previously the rlock was released after collecting hit/miss info, then block pointers were written to without the lock held. This allowed eviction to invalidate block pointers during writes. Fix by keeping the rlock held through the entire read-and-write phase using scoped lifetime.

Pull Request resolved: pytorch#5536

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Split from D95983752

Reviewed By: r-barnes

Differential Revision: D98427441

Pulled By: q10
@q10 q10 force-pushed the export-D98427441 branch from b763e39 to ae43271 Compare June 1, 2026 17:46
@meta-codesync meta-codesync Bot changed the title Fix DramKV race: hold rlock during inplace update writes (#5536) Fix DramKV race: hold rlock during inplace update writes (#5807) Jun 1, 2026
@meta-codesync meta-codesync Bot closed this in 1509423 Jun 1, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Jun 1, 2026

@q10 merged this pull request in 1509423.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants