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

Suspiciously intersecting memory ranges #32

Open
kvark opened this issue Oct 11, 2020 · 1 comment
Open

Suspiciously intersecting memory ranges #32

kvark opened this issue Oct 11, 2020 · 1 comment
Assignees
Labels
module: memory gfx-memory issues type: bug Something isn't working

Comments

@kvark
Copy link
Member

kvark commented Oct 11, 2020

Seeing this beauty:

general.rs(613) 		Size 6144, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 1, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..49152 }), blocks: 192 })
general.rs(613) 		Size 49152, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..393216 }), blocks: 254 })
general.rs(613) 		Size 393216, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..3145728 }), blocks: 240 })
general.rs(613) 		Size 98304, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..786432 }), blocks: 240 })
general.rs(613) 		Size 786432, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..6291456 }), blocks: 240 })
general.rs(613) 		Size 196608, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..1572864 }), blocks: 240 })
general.rs(613) 		Size 1572864, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..12582912 }), blocks: 240 })
general.rs(613) 		Size 3145728, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..25165824 }), blocks: 240 })
general.rs(613) 		Size 6291456, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..50331648 }), blocks: 240 })
general.rs(613) 		Size 12582912, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..100663296 }), blocks: 240 })
general.rs(613) 		Size 25165824, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..201326592 }), blocks: 240 })
general.rs(613) 		Size 50331648, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: General(GeneralBlock { block_index: 0, chunk_index: 0, count: 4, memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000), range: 0..402653184 }), blocks: 240 })
general.rs(613) 		Size 100663296, ready BitSet { mask: 1, groups: 1 }
general.rs(615) 			(0, Chunk { flavor: Dedicated { memory: Memory { raw: Memory { raw: 0x7e000000007e }, size: 805306368, properties: CPU_VISIBLE | COHERENT, non_coherent_atom_size: None }, ptr: Some(0x7f0d3c000000) }, blocks: 240 })

Need to figure out what's happening here. It could be that we only need small amount of memory but using the whole 800Mb chunk for some reason.

@kvark kvark added type: bug Something isn't working module: memory gfx-memory issues labels Oct 11, 2020
@kvark
Copy link
Member Author

kvark commented Oct 12, 2020

Turns out the intersection here is expected. The whole chain of allocation is spawned by a single small allocation. alloc_chunk tries to allocate MIN_BLOCKS_PER_CHUNK number of block sizes, doesn't find existing chunks of that 8x size, and requests a new block. This in turn leads to alloc_chunk again, and stops only when we reach the max_chunk_size...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: memory gfx-memory issues type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant