getattr is very expensive and in important cases only gets called to get the size. This can be optimized with a dedicated routine which obtains that statistic.
As a step towards there make size-only consumers use a dedicated routine.
Differential D37885
vfs: add vn_getsize Authored by mjg on Dec 27 2022, 9:45 PM. Tags None Referenced Files
Details
getattr is very expensive and in important cases only gets called to get the size. This can be optimized with a dedicated routine which obtains that statistic. As a step towards there make size-only consumers use a dedicated routine.
Diff Detail
Event TimelineComment Actions For stable. we have reserved VOP slots that can be used, but usually we do not consider VFS to fall under the stable branch ABI stability guarantee (same as VM). That said, I generally do not like the proliferation of specialized VOPs duplicating existing interfaces. We already have VOP_GETATTR(), and VOP_STAT(). To add VOP_GETSIZE(), we need a clear indication that it is significant improvement in some load. I suspect it would be only tmpfs, with specific usage, if anything. Comment Actions Well then what was the point of adding vn_getsize() if it wasn't eventually going to be backed by a VOP? Comment Actions It is a convenient wrapper, requiring less ceremony to get the vnode size. |