[lustre-discuss] Two fd's for a single file, 1 with O_DIRECT, 1 without O_DIRECT
Andreas Dilger
adilger at ddn.com
Thu Jan 9 12:34:11 PST 2025
Hi John,
can you trace to determine if this cache flush is triggered by Lustre DLM lock management or if this is triggered by the kernel (i.e. does ext4 or xfs have the same behavior with two fds)?
There was work done recently to be able to pin pages on the client so that they are not evicted by e.g. LDLM LRU aging:
https://jira.whamcloud.com/browse/LU-17463
but this hasn't finished landing yet.
On Dec 19, 2024, at 15:53, John Bauer <bauerj at iodoctors.com> wrote:
>
> I have a file where I would like to keep part of the file in system cache and the other part not. So I open the file twice, once with O_DIRECT, and once without O_DIRECT.
> I have written a simple testcase where I write the first 50 MB of the file without DIRECT, and the second 50M with O_DIRECT. The file is striped 4x1M. It would appear that when the second 50M of the file is written O_DIRECT, the first 50MB of the file is dropped from system cache. Both fd remain open during the entire process. From what I can tell, it seems that once a given stripe is impacted by an O_DIRECT write then the entire stripe is dropped from cache. Is this the expected behavior?
Cheers, Andreas
—
Andreas Dilger
Lustre Principal Architect
Whamcloud/DDN
More information about the lustre-discuss
mailing list