Was genau macht die Option ikeep mount auf XFS?

1269
ithisa

Ich habe einen Laptop mit einer 512 GB SSD darin. Ich verwende XFS als /Dateisystem, das mit angehängt ist noatime,discard,ikeep. Der ikeepGrund dafür liegt in einigen Mailinglisten, wie langsam discardund mit TRIM auf XFS gearbeitet wurde, und es wurde vorgeschlagen ikeep, die Leistung zu verbessern. In den Linux-Kernel-Dokumenten heißt es jedoch:

Wenn ikeep angegeben ist, löscht XFS leere Inode-Cluster nicht und speichert sie auf der Festplatte. ikeep ist das traditionelle XFS-Verhalten. Wenn noikeep angegeben ist, werden leere Inode-Cluster an den Pool für freien Speicherplatz zurückgegeben. Der Standard ist noikeep für Nicht-DMAPI-Mounts, während ikeep der Standard ist, wenn DMAPI verwendet wird.

Bedeutet dies, dass kein Raum würde jemals freigegeben, wenn ich ikeep, wodurch Verwerfungs strittig, da, egal wie viele Dateien, die ich löschen, der freie Speicherplatz erhöhen würde nicht? Dies scheint eine absurde Idee für das "traditionelle XFS-Verhalten" zu sein.

Was genau macht ikeep?

3

1 Antwort auf die Frage

3
Old Pro

ikeep does exactly what the documents say it does. I believe your confusion comes from not understanding what an inode is. An inode stores meta-data about the file. It is part of the filesystem structure and contains none of the data in the file. As the description of the patch which introduced the need for ikeep explains:

XFS dynamically allocates space for inodes as they are created, this is different from many other filesystems where inode space is statically allocated at mkfs time. While inode space is dynamically allocated, it is never freed - up until now that is.

This non-freeing of space tends to lead to fragmentation on filesystems where lots of files come and go. It can also lead to inodes and their parent directories being scattered around the disk more.

Most filesystems allocate all the inodes they will ever need when you "make the filesystem" a.k.a. "format the drive") and never delete them. XFS is different in that it makes them on demand.

Fragmentation and things being "scattered around the disk more" cause significant performance problems for traditional spinning-platter disks. However, on an SSD, those things are no problem at all. Conversely, deleting disk blocks is a significant performance problem on SSDs while being no problem for spinning-disks. So while the patch making it the default to delete empty inodes was a performance improvement for spinning-disks, it actually made performance worse on SSDs. Hence the recommendation to use ikeep on SSDs.

Wie genau führt diese Nichtbefreiung von Inoden zu einer Fragmentierung? ithisa vor 10 Jahren 0
Es ist tatsächlich nicht das Nicht-Freigeben von Inodes, das eine Fragmentierung verursacht, sondern die dynamische Zuweisung von Inodes parallel zu der Zuweisung von Blöcken für Dateidaten, die eine Fragmentierung verursacht. Die Nichtbefreiung von Inoden blockiert vielmehr die Fragmentierung, die überhaupt verursacht wurde. Old Pro vor 10 Jahren 1
Hmm. Der einzige Grund, weshalb sich XFS dazu entschied, war, ein wenig mehr Platz und ein wenig weniger Zeit für mkfs zu beanspruchen? Oo ithisa vor 10 Jahren 0
XFS unterstützt den parallelen Betrieb und die dynamische Erweiterung des Dateisystems. Beide werden durch dynamische Zuordnung von Inodes unterstützt. Old Pro vor 10 Jahren 0