Option to use O_DIRECT #29
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: a-j-wood/pv#29
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Provide an option to use the O_DIRECT flag to bypass cache.
I think this one can be closed now as of
ae81f83e9b
.That's true - thanks.
Hi @thesamesam ,

when I used option --direct-io and the command like :
cat data4002.tar.gz | pv --rate-limit=10485760 --buffer-size=4194304 --direct-io --sync >>/tdsqlbackup/testpv/3333.tar.gz
the /tdsqlbackup/ is an nfs device, mounted like :172.21.16.6:/tdsqlbackup /tdsqlbackup nfs rw,bg,nfsvers=3,tcp,hard,timeo=600,rsize=4194304,wsize=4194304,_netdev 0 0
I found "--direct-io" option can not bypass os page cache ,
Is there anywhere i missed ?
Hello
I'm not sure how much effect "
--direct-io
" will have over NFS. The manual page for open(2) says that O_DIRECT will only bypass the page cache on the client, not the server, for example.> Hello
>
> I'm not sure how much effect "
--direct-io
" will have over NFS. The manual page for open(2) says that O_DIRECT will only bypass the page cache on the client, not the server, for example.yep I know. the cache I showed before is produced on client side ,not on nfs server side.
OK
Can you please use "
strace
" on the command you're trying, and see if you can determine whether it's callingfcntl()
to set O_DIRECT on the relevant file descriptors?If it's not, that may be a bug in pv; if it is, then there's not much we can do since O_DIRECT is having no effect, which is up to the OS.
Hi.
I capture the strace, It seemed that fcntl(1, F_SETFL, O_WRONLY|O_APPEND|O_DIRECT|O_LARGEFILE) = -1 EINVAL (Invalid argument), O_APPEND can not support this. pv has no bug at this situation~
Thank you for the investigation and confirmation.