Does XFS provide any control for the placement of files on disk ?
Something like policy modules for disk placement ? clustering
of files for example ?
Not explicitly, there are some useful facts about how xfs lays things
out which you can use to get limited placement control.
XFS divides a filesystem into allocation groups, read the mkfs_xfs
man page. You can specify the size of allocation groups, and you can
get allocation groups to start on stripe boundaries in a raid setup.
The simple rules of placement are:
XFS will attempt to place a new directory in a different allocation
group than its parent inode.
XFS will attempt to place a new file inode in the same allocation
group as its parent inode.
Blocks in a file (directory blocks in a directory) will prefer the same
allocation group as the inode - in fact the same allocation group as the
previous chunk in the file. It will also first look for a chunk of free
space close to the previous one.
If an allocation group is too full, or another cpu is currently
allocating space from it, then the allocator will move on to another
xfs_bmap can tell you all sorts of things about where the blocks of a file
are on the disk.
There has been talk in the past about allowing more explicit placement and
being able to map more directly onto the actual LUNs. I do not know if there
is work in progress to do this.