mesa/src/vulkan
Jason Ekstrand fd64598462 vk/allocator: Fix a data race in the state pool
The previous algorithm had a race because of the way we were using
__sync_fetch_and_add for everything.  In particular, the concept of
"returning" over-allocated states in the "next > end" case was completely
bogus.  If too many threads were hitting the state pool at the same time,
it was possible to have the following sequence:

A: Get an offset (next == end)
B: Get an offset (next > end)
A: Resize the pool (now next < end by a lot)
C: Get an offset (next < end)
B: Return the over-allocated offset
D: Get an offset

in which case D will get the same offset as C.  The solution to this race
is to get rid of the concept of "returning" over-allocated states.
Instead, the thread that gets a new block simply sets the next and end
offsets directly and threads that over-allocate don't return anything and
just futex-wait.  Since you can only ever hit the over-allocate case if
someone else hit the "next == end" case and hasn't resized yet, you're
guaranteed that the end value will get updated and the futex won't block
forever.
2015-08-03 00:38:48 -07:00
..
.gitignore vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_allocator.c vk/allocator: Fix a data race in the state pool 2015-08-03 00:38:48 -07:00
anv_aub.c vk/aub: Use the data directly from the execbuf2 2015-07-28 16:53:45 -07:00
anv_aub.h vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_batch_chain.c vk/batch_chain: Decrement num_relocs instead of incrementing it 2015-07-31 09:11:47 -07:00
anv_cmd_buffer.c vk: Re-name command buffer implementation files 2015-07-30 15:00:42 -07:00
anv_compiler.cpp vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_device.c vk/allocator: Add an anv_state_pool_finish function 2015-07-31 10:38:28 -07:00
anv_entrypoints_gen.py vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_formats.c vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_gem.c vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_image.c vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_intel.c vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_meta.c vk/meta: Destroy shader modules 2015-07-22 17:51:26 -07:00
anv_pipeline.c vk/batch: Make relocs a pointer to a relocation list 2015-07-29 12:01:08 -07:00
anv_private.h vk/allocator: Add an anv_state_pool_finish function 2015-07-31 10:38:28 -07:00
anv_query.c vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_util.c vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
anv_x11.c vk: Prefix most filenames with anv 2015-07-17 20:25:38 -07:00
gen7_pack.h vk/headers: Update to new generated gen headers 2015-07-29 11:02:33 -07:00
gen8_pack.h vk/headers: Update to new generated gen headers 2015-07-29 11:02:33 -07:00
gen75_pack.h vk/headers: Update to new generated gen headers 2015-07-29 11:02:33 -07:00
glsl_scraper.py vk/glsl: Replace raw casts 2015-07-15 15:51:37 -07:00
Makefile.am vk: Re-name command buffer implementation files 2015-07-30 15:00:42 -07:00