The default allocation behaviour of XFS for new files is to place them in the same allocation group as their parent directory.
Since files and their parent directories are often accessed in close succession, this minimises costly disk seeks.
The allocator will also attempt to place newly created directories in different allocation groups.
Combined, these policies help group directories of files together on disk, even if they're being written to concurrently.
Allocation policies in XFS can change due to