space_getcell() improvement
Two thoughts about space_getcell()
:
-
When constructing the cells, we always call it 8 times in a row to get the 8 progenitors of a cell. This involves 8 locks of the space structure. Could we not return a linked list of 8 cells instead and lock the space only once ? Although it looked like we were limited by particle swapping, it might help with the scaling of
cell_split()
-
Since any thread can call
space_getcell()
, any thread can allocate the cells. As a consequence they end up randomly scattered among the thread NUMA regions. Especially after multiple rebuilds. The linked-list is jumping all over memory and so is the cell-tree once constructed. Does it matter and could we do anything about it ?