| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…35473) The free threading build uses QSBR to delay the freeing of dictionary keys and list arrays when the objects are accessed by multiple threads in order to allow concurrent reads to proceed with holding the object lock. The requests are processed in batches to reduce execution overhead, but for large memory blocks this can lead to excess memory usage. Take into account the size of the memory block when deciding when to process QSBR requests. Also track the amount of memory being held by QSBR for mimalloc pages. Advance the write sequence if this memory exceeds a limit. Advancing the sequence will allow it to be freed more quickly. Process the held QSBR items from the "eval breaker", rather than from `_PyMem_FreeDelayed()`. This gives a higher chance that the global read sequence has advanced enough so that items can be freed. (cherry picked from commit 113de85) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com> Co-authored-by: Sam Gross <colesbury@gmail.com>
|
@Yhg1s This needs release manager approval due to the ABI dump file changing. The ABI change is to the _qsbr_thread_state structure, which I believe is not actually exposed to extensions. Hugo already approved the 3.14 backport of this change. |
Sorry, something went wrong.
|
To be honest I'm more concerned about _PyMem_FreeDelayed's signature change than about the structure change, but given that it's a free-threading only API and I don't think it's been used in any extension modules I'm okay with that. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The free threading build uses QSBR to delay the freeing of dictionary keys and list arrays when the objects are accessed by multiple threads in order to allow concurrent reads to proceed with holding the object lock. The requests are processed in batches to reduce execution overhead, but for large memory blocks this can lead to excess memory usage.
Take into account the size of the memory block when deciding when to process QSBR requests.
Also track the amount of memory being held by QSBR for mimalloc pages. Advance the write sequence if this memory exceeds a limit. Advancing the sequence will allow it to be freed more quickly.
Process the held QSBR items from the "eval breaker", rather than from _PyMem_FreeDelayed(). This gives a higher chance that the global read sequence has advanced enough so that items can be freed.
(cherry picked from commit 113de85)
Co-authored-by: Sam Gross colesbury@gmail.com