On 12/7/23 07:46, Christoph Hellwig wrote:
On Wed, Nov 29, 2023 at 05:33:09PM -0800, Bart Van Assche wrote:
Revert commit 7b12e49669c9 ("fs: remove fs.f_write_hint") to enable testing
write hint support with fio and direct I/O.
To enable testing seems like a pretty bad argument for bloating struct
file. I'd much prefer to not restore it, but if you want to do so
please write a convincing commit log.
Hi Christoph,
I have submitted a pull request for fio such that my tests can be run
even if F_SET_FILE_RW_HINT is not supported (see also
https://github.com/axboe/fio/pull/1682).
The only other application that I found that uses F_SET_FILE_RW_HINT is
Ceph. Do we want to make the Ceph code work again that uses
F_SET_FILE_RW_HINT? I think this code cannot be converted to
F_SET_RW_HINT.
From the Ceph source code:
----------------------------------------------------------------------
int KernelDevice::choose_fd(bool buffered, int write_hint) const
{
#if defined(F_SET_FILE_RW_HINT)
if (!enable_wrt)
write_hint = WRITE_LIFE_NOT_SET;
#else
// Without WRITE_LIFE capabilities, only one file is used.
// And rocksdb sets this value also to > 0, so we need to catch this
// here instead of trusting rocksdb to set write_hint.
write_hint = WRITE_LIFE_NOT_SET;
#endif
return buffered ? fd_buffereds[write_hint] : fd_directs[write_hint];
}
----------------------------------------------------------------------
Thanks,
Bart.